* Use this hook for autoreviewing. Merge to one function again.
* Remove template ID query for $usestabletemplates, not needed
* Improve includes change diff if $usestabletemplates is on
instead.
$tools: array of tools
+'newRevisionFromEditComplete': called when a revision was inserted due to an edit
+$title: the page title
+$rev: the new revision
+$baseID: the revision ID this was based off, if any
+
'OutputPageBeforeHTML': a page has been processed by the parser and
the resulting HTML is about to be displayed.
$parserOutput: the parserOutput (object) that corresponds to the page
* EDIT_NEW is specified and the article does exist, a duplicate key error will cause an exception
* to be thrown from the Database. These two conditions are also possible with auto-detection due
* to MediaWiki's performance-optimised locking strategy.
+ * @param $baseRevId, the revision ID this edit was based off, if any
*
* @return bool success
*/
- function doEdit( $text, $summary, $flags = 0 ) {
+ function doEdit( $text, $summary, $flags = 0, $baseRevId = false ) {
global $wgUser, $wgDBtransactions;
wfProfileIn( __METHOD__ );
$dbw->begin();
$revisionId = $revision->insertOn( $dbw );
+
+ wfRunHooks( 'newRevisionFromEditComplete', array($this->mTitle, $revision, $baseRevId) );
# Update page
$ok = $this->updateRevisionOn( $dbw, $revision, $lastRevision );
'text' => $text
) );
$revisionId = $revision->insertOn( $dbw );
+
+ wfRunHooks( 'newRevisionFromEditComplete', array($this->mTitle, $revision, false) );
$this->mTitle->resetArticleID( $newid );
# Insert a null revision
$nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );
$nullRevId = $nullRevision->insertOn( $dbw );
+
+ wfRunHooks( 'newRevisionFromEditComplete', array($this->mTitle, $nullRevision, false) );
# Update page record
$dbw->update( 'page',
if( $bot && ($wgUser->isAllowed('markbotedits') || $wgUser->isAllowed('bot')) )
$flags |= EDIT_FORCE_BOT;
- $this->doEdit( $target->getText(), $summary, $flags );
+ $this->doEdit( $target->getText(), $summary, $flags, $target->getId() );
wfRunHooks( 'ArticleRollbackComplete', array( $this, $wgUser, $target ) );
'minor_edit' => $minor ? 1 : 0,
) );
$revision->insertOn( $dbw );
+ wfRunHooks( 'newRevisionFromEditComplete', array($this->mTitle, $revision, false) );
$this->updateRevisionOn( $dbw, $revision );
$dbw->commit();
$comment = $detail; // quick
$dbw = wfGetDB( DB_MASTER );
- $nullRevision = Revision::newNullRevision(
- $dbw, $title->getArticleId(), $comment, true );
+ $nullRevision = Revision::newNullRevision( $dbw, $title->getArticleId(), $comment, true );
$nullRevision->insertOn( $dbw );
+ wfRunHooks( 'newRevisionFromEditComplete', array($title, $nullRevision, false) );
# Update page record
$article = new Article( $title );
$article->updateRevisionOn( $dbw, $nullRevision );
# Save a null revision in the page's history notifying of the move
$nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true );
$nullRevId = $nullRevision->insertOn( $dbw );
+ wfRunHooks( 'newRevisionFromEditComplete', array($nt, $nullRevision, false) );
# Change the name of the target page:
$dbw->update( 'page',
'comment' => $comment,
'text' => $redirectText ) );
$redirectRevision->insertOn( $dbw );
+ wfRunHooks( 'newRevisionFromEditComplete', array($this, $redirectRevision, false) );
$redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 );
# Now, we record the link from the redirect to the new title.
# Save a null revision in the page's history notifying of the move
$nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true );
$nullRevId = $nullRevision->insertOn( $dbw );
+ wfRunHooks( 'newRevisionFromEditComplete', array($nt, $nullRevision, false) );
# Rename page entry
$dbw->update( 'page',
'comment' => $comment,
'text' => $redirectText ) );
$redirectRevision->insertOn( $dbw );
+ wfRunHooks( 'newRevisionFromEditComplete', array($this, $redirectRevision, false) );
$redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 );
# Record the just-created redirect's linking to the page
# Create a null revision
$nullRevision = Revision::newNullRevision( $dbw, $descTitle->getArticleId(), $log->getRcComment(), false );
$nullRevision->insertOn( $dbw );
+ wfRunHooks( 'newRevisionFromEditComplete', array($descTitle, $nullRevision, false) );
$article->updateRevisionOn( $dbw, $nullRevision );
# Invalidate the cache for the description page
# Create a null revision
$nullRevision = Revision::newNullRevision( $dbw, $descTitle->getArticleId(), $log->getRcComment(), false );
$nullRevision->insertOn( $dbw );
+ wfRunHooks( 'newRevisionFromEditComplete', array($descTitle, $nullRevision, false) );
$article->updateRevisionOn( $dbw, $nullRevision );
# Invalidate the cache for the description page