X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FMovePage.php;h=736cd8d6509ff3a6b6fc6034820cbfa9dc6a5288;hb=1d41a1a7345c38a87c047f06c5f75d3dace43a29;hp=2cd9698c0f5a654a237ce4289fa5205c8ef0fc72;hpb=f1a890c34cebd8744bf3a6277734275fb975575a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MovePage.php b/includes/MovePage.php index 2cd9698c0f..736cd8d650 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -247,7 +247,7 @@ class MovePage { RepoGroup::singleton()->clearCache( $this->newTitle ); # clear false negative cache } - $dbw->begin( __METHOD__ ); # If $file was a LocalFile, its transaction would have closed our own. + $dbw->startAtomic( __METHOD__ ); $pageid = $this->oldTitle->getArticleID( Title::GAID_FOR_UPDATE ); $protected = $this->oldTitle->isProtected(); @@ -369,12 +369,13 @@ class MovePage { WatchedItem::duplicateEntries( $this->oldTitle, $this->newTitle ); } - $dbw->commit( __METHOD__ ); + $dbw->endAtomic( __METHOD__ ); + + $params = array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason ); + $dbw->onTransactionIdle( function () use ( $params ) { + Hooks::run( 'TitleMoveComplete', $params ); + } ); - Hooks::run( - 'TitleMoveComplete', - array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason ) - ); return Status::newGood(); }