57 $rev = $this->page->getRevision();
58 if ( $from ===
null ) {
59 throw new ErrorPageError(
'rollbackfailed',
'rollback-missingparam' );
62 throw new ErrorPageError(
'rollbackfailed',
'rollback-missingrevision' );
64 if ( $from !==
$rev->getUserText() ) {
66 $this->
getTitle()->getPrefixedText(),
73 $errors = $this->page->doRollback(
82 if ( in_array( [
'actionthrottledtext' ], $errors ) ) {
86 if ( isset( $errors[0][0] ) &&
87 ( $errors[0][0] ==
'alreadyrolled' || $errors[0][0] ==
'cantrollback' )
89 $this->
getOutput()->setPageTitle( $this->
msg(
'rollbackfailed' ) );
90 $errArray = $errors[0];
91 $errMsg = array_shift( $errArray );
92 $this->
getOutput()->addWikiMsgArray( $errMsg, $errArray );
94 if ( isset( $data[
'current'] ) ) {
96 $current = $data[
'current'];
98 if ( $current->getComment() !=
'' ) {
99 $this->
getOutput()->addHTML( $this->
msg(
'editcomment' )->rawParams(
107 # NOTE: Permission errors already handled by Action::checkExecute.
108 if ( $errors == [ [
'readonlytext' ] ] ) {
112 # XXX: Would be nice if ErrorPageError could take multiple errors, and/or a status object.
113 # Right now, we only show the first error
114 foreach ( $errors as $error ) {
115 throw new ErrorPageError(
'rollbackfailed', $error[0], array_slice( $error, 1 ) );
119 $current = $data[
'current'];
120 $target = $data[
'target'];
121 $newId = $data[
'newid'];
122 $this->
getOutput()->setPageTitle( $this->
msg(
'actioncomplete' ) );
123 $this->
getOutput()->setRobotPolicy(
'noindex,nofollow' );
128 $this->
msg(
'rollback-success' )
129 ->rawParams( $old, $new )
135 if ( $user->getBoolOption(
'watchrollback' ) ) {
141 if ( !
$request->getBool(
'hidediff',
false ) &&
142 !$this->getUser()->getBoolOption(
'norollbackdiff' )
144 $contentHandler = $current->getContentHandler();
145 $de = $contentHandler->createDifferenceEngine(
152 $de->showDiff(
'',
'' );
wfTransactionalTimeLimit()
Set PHP's time limit to the larger of php.ini or $wgTransactionalTimeLimit.
getTitle()
Shortcut to get the Title object from the page.
getContext()
Get the IContextSource in use here.
getOutput()
Get the OutputPage being used for this instance.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getUser()
Shortcut to get the User being used for this instance.
getRequest()
Get the WebRequest being used for this instance.
An error page which can definitely be safely rendered using the OutputPage.
static revUserTools( $rev, $isPublic=false)
Generate a user tool link cluster if the current user is allowed to view it.
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
User interface for the rollback action.
getDescription()
Returns the description that goes below the <h1> tag.
getRestriction()
Get the permission required to perform this action.
onView()
Temporarily unused message keys due to T88044/T136375:
doesWrites()
Indicates whether this action may perform database writes.
getName()
Return the name of the action this object responds to.
Show an error when the user hits a rate limit.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev