addSecondaryDataUpdate throwing an exception. These functions will be removed in 1.26,
since they interfere with caching of ParserOutput objects.
* Introduced new hook 'SecondaryDataUpdates' that allows extensions to inject custom updates.
+* EditPage::attemptSave has been modified not to call handleStatus itself and
+ instead just returns the Status object. Extension calling it should be aware of
+ this.
== Compatibility ==
saved, that is before WikiPage::doEditContent() is called
$editpage_Obj: the current EditPage object
+'EditPage::attemptSave:after': Called after an article save attempt
+$editpage_Obj: the current EditPage object
+$status: the resulting Status object
+$resultDetails: Result details array
+
'EditPage::importFormData': allow extensions to read additional data
posted in the form
$editpage: EditPage instance
# in the back door with a hand-edited submission URL.
if ( 'save' == $this->formtype ) {
- if ( !$this->attemptSave() ) {
+ $resultDetails = null;
+ $status = $this->attemptSave( $resultDetails );
+ if ( !$this->handleStatus( $status, $resultDetails ) ) {
return;
}
}
/**
* Attempt submission
+ * @param array $resultDetails See docs for $result in internalAttemptSave
* @throws UserBlockedError|ReadOnlyError|ThrottledError|PermissionsError
- * @return bool False if output is done, true if the rest of the form should be displayed
+ * @return Status The resulting status object.
*/
- public function attemptSave() {
+ public function attemptSave( &$resultDetails = false ) {
global $wgUser;
- $resultDetails = false;
# Allow bots to exempt some edits from bot flagging
$bot = $wgUser->isAllowed( 'bot' ) && $this->bot;
$status = $this->internalAttemptSave( $resultDetails, $bot );
- return $this->handleStatus( $status, $resultDetails );
+ Hooks::run( 'EditPage::attemptSave:after', array( $this, $status, $resultDetails ) );
+
+ return $status;
}
/**
'wpIgnoreBlankSummary' => true,
'wpIgnoreBlankArticle' => true,
'wpIgnoreSelfRedirect' => true,
+ 'bot' => $params['bot'],
);
if ( !is_null( $params['summary'] ) ) {
$oldRequest = $wgRequest;
$wgRequest = $req;
- $status = $ep->internalAttemptSave( $result, $user->isAllowed( 'bot' ) && $params['bot'] );
+ $status = $ep->attemptSave( $result );
$wgRequest = $oldRequest;
switch ( $status->value ) {