instead.
$tools: array of tools
-'newRevisionFromEditComplete': called when a revision was inserted due to an edit
-$title: the page title
+'NewRevisionFromEditComplete': called when a revision was inserted due to an edit
+$article: the page title
$rev: the new revision
$baseID: the revision ID this was based off, if any
# Update page
$ok = $this->updateRevisionOn( $dbw, $revision, $lastRevision );
- wfRunHooks( 'newRevisionFromEditComplete', array($this->mTitle, $revision, $baseRevId) );
+ wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, $baseRevId) );
if( !$ok ) {
/* Belated edit conflict! Run away!! */
# Update the page record with revision data
$this->updateRevisionOn( $dbw, $revision, 0 );
- wfRunHooks( 'newRevisionFromEditComplete', array($this->mTitle, $revision, false) );
+ wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) );
if( !( $flags & EDIT_SUPPRESS_RC ) ) {
$rcid = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $wgUser, $summary, $bot,
), 'Article::protect'
);
- wfRunHooks( 'newRevisionFromEditComplete', array($this->mTitle, $nullRevision, false) );
+ wfRunHooks( 'NewRevisionFromEditComplete', array($this, $nullRevision, false) );
wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) );
# Update the protection log
$this->updateRevisionOn( $dbw, $revision );
$dbw->commit();
- wfRunHooks( 'newRevisionFromEditComplete', array($this->mTitle, $revision, false) );
+ wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) );
wfProfileOut( __METHOD__ );
}
$dbw = wfGetDB( DB_MASTER );
$nullRevision = Revision::newNullRevision( $dbw, $title->getArticleId(), $comment, true );
$nullRevision->insertOn( $dbw );
- wfRunHooks( 'newRevisionFromEditComplete', array($title, $nullRevision, false) );
- # Update page record
$article = new Article( $title );
+ # Update page record
$article->updateRevisionOn( $dbw, $nullRevision );
+ wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, false) );
} else {
$wgOut->addHtml( '<li>' . wfMsgHtml( 'import-nonewrevisions' ) . '</li>' );
}
# 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) );
+
+ $article = new Article( $nt );
# Change the name of the target page:
$dbw->update( 'page',
$fname
);
$nt->resetArticleID( $oldid );
+
+ wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, false) );
# Recreate the redirect, this time in the other direction.
if($createRedirect || !$wgUser->isAllowed('suppressredirect'))
'comment' => $comment,
'text' => $redirectText ) );
$redirectRevision->insertOn( $dbw );
- wfRunHooks( 'newRevisionFromEditComplete', array($this, $redirectRevision, false) );
$redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 );
+
+ wfRunHooks( 'NewRevisionFromEditComplete', array($redirectArticle, $redirectRevision, false) );
# Now, we record the link from the redirect to the new title.
# It should have no other outgoing links...
# 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) );
+
+ $article = new Article( $nt );
# Rename page entry
$dbw->update( 'page',
$fname
);
$nt->resetArticleID( $oldid );
+
+ wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, false) );
if($createRedirect || !$wgUser->isAllowed('suppressredirect'))
{
'comment' => $comment,
'text' => $redirectText ) );
$redirectRevision->insertOn( $dbw );
- wfRunHooks( 'newRevisionFromEditComplete', array($this, $redirectRevision, false) );
$redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 );
+
+ wfRunHooks( 'NewRevisionFromEditComplete', array($redirectArticle, $redirectRevision, false) );
# Record the just-created redirect's linking to the page
$dbw->insert( 'pagelinks',
# Create a null revision
$nullRevision = Revision::newNullRevision( $dbw, $descTitle->getArticleId(), $log->getRcComment(), false );
$nullRevision->insertOn( $dbw );
- wfRunHooks( 'newRevisionFromEditComplete', array($descTitle, $nullRevision, false) );
+
+ wfRunHooks( 'NewRevisionFromEditComplete', array($article, $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) );
+
+ wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, false) );
$article->updateRevisionOn( $dbw, $nullRevision );
# Invalidate the cache for the description page