* @param User $user The user doing the edit
* @param string $serialFormat Format for storing the content in the
* database.
+ * @param array|null $tags Change tags to apply to this edit
+ * Callers are responsible for permission checks
+ * (with ChangeTags::canAddTagsAccompanyingChange)
*
* @throws MWException
* @return Status Possible errors:
*/
public function doEditContent(
Content $content, $summary, $flags = 0, $baseRevId = false,
- User $user = null, $serialFormat = null
+ User $user = null, $serialFormat = null, $tags = null
) {
global $wgUser, $wgUseAutomaticEditSummaries;
'oldContent' => $old_content,
'oldId' => $this->getLatest(),
'oldIsRedirect' => $this->isRedirect(),
- 'oldCountable' => $this->isCountable()
+ 'oldCountable' => $this->isCountable(),
+ 'tags' => ( $tags !== null ) ? (array)$tags : array()
);
// Actually create the revision and create/update the page
$oldContent ? $oldContent->getSize() : 0,
$newsize,
$revisionId,
- $patrolled
+ $patrolled,
+ $meta['tags']
);
}
'',
$newsize,
$revisionId,
- $patrolled
+ $patrolled,
+ $meta['tags']
);
}
* success : 'summary' (str), 'current' (rev), 'target' (rev)
*
* @param User $user The user performing the rollback
+ * @param array|null $tags Change tags to apply to the rollback
+ * Callers are responsible for permission checks
+ * (with ChangeTags::canAddTagsAccompanyingChange)
+ *
* @return array Array of errors, each error formatted as
* array(messagekey, param1, param2, ...).
* On success, the array is empty. This array can also be passed to
* OutputPage::showPermissionsErrorPage().
*/
public function doRollback(
- $fromP, $summary, $token, $bot, &$resultDetails, User $user
+ $fromP, $summary, $token, $bot, &$resultDetails, User $user, $tags = null
) {
$resultDetails = null;
return $errors;
}
- return $this->commitRollback( $fromP, $summary, $bot, $resultDetails, $user );
+ return $this->commitRollback( $fromP, $summary, $bot, $resultDetails, $user, $tags );
}
/**
*
* @param array $resultDetails Contains result-specific array of additional values
* @param User $guser The user performing the rollback
+ * @param array|null $tags Change tags to apply to the rollback
+ * Callers are responsible for permission checks
+ * (with ChangeTags::canAddTagsAccompanyingChange)
+ *
* @return array
*/
- public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser ) {
+ public function commitRollback( $fromP, $summary, $bot,
+ &$resultDetails, User $guser, $tags = null
+ ) {
global $wgUseRCPatrol, $wgContLang;
$dbw = wfGetDB( DB_MASTER );
$summary,
$flags,
$target->getId(),
- $guser
+ $guser,
+ null,
+ $tags
);
// Set patrolling and bot flag on the edits, which gets rollbacked.