dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Avoid unstubbing $wgUser before the end of Setup.php in User::getBlockedStatus()"
[lhc/web/wiklou.git]
/
includes
/
MovePage.php
diff --git
a/includes/MovePage.php
b/includes/MovePage.php
index
0f9374a
..
fb0ca8c
100644
(file)
--- a/
includes/MovePage.php
+++ b/
includes/MovePage.php
@@
-252,7
+252,7
@@
class MovePage {
$protected = $this->oldTitle->isProtected();
// Do the actual move
$protected = $this->oldTitle->isProtected();
// Do the actual move
- $this->moveToInternal( $user, $this->newTitle, $reason, $createRedirect );
+ $
nullRevision = $
this->moveToInternal( $user, $this->newTitle, $reason, $createRedirect );
// Refresh the sortkey for this row. Be careful to avoid resetting
// cl_timestamp, which may disturb time-based lists on some sites.
// Refresh the sortkey for this row. Be careful to avoid resetting
// cl_timestamp, which may disturb time-based lists on some sites.
@@
-369,10
+369,26
@@
class MovePage {
WatchedItem::duplicateEntries( $this->oldTitle, $this->newTitle );
}
WatchedItem::duplicateEntries( $this->oldTitle, $this->newTitle );
}
+ Hooks::run(
+ 'TitleMoveCompleting',
+ array( $this->oldTitle, $this->newTitle,
+ $user, $pageid, $redirid, $reason, $nullRevision )
+ );
+
$dbw->endAtomic( __METHOD__ );
$dbw->endAtomic( __METHOD__ );
- $params = array( $this->oldTitle, $this->newTitle, $user, $pageid, $redirid, $reason );
- $dbw->onTransactionIdle( function () use ( $params ) {
+ $params = array(
+ &$this->oldTitle,
+ &$this->newTitle,
+ &$user,
+ $pageid,
+ $redirid,
+ $reason,
+ $nullRevision
+ );
+ $dbw->onTransactionIdle( function () use ( $params, $dbw ) {
+ // Keep each single hook handler atomic
+ $dbw->setFlag( DBO_TRX ); // flag is automatically reset by DB layer
Hooks::run( 'TitleMoveComplete', $params );
} );
Hooks::run( 'TitleMoveComplete', $params );
} );
@@
-389,6
+405,7
@@
class MovePage {
* @param string $reason The reason for the move
* @param bool $createRedirect Whether to leave a redirect at the old title. Does not check
* if the user has the suppressredirect right
* @param string $reason The reason for the move
* @param bool $createRedirect Whether to leave a redirect at the old title. Does not check
* if the user has the suppressredirect right
+ * @return Revision the revision created by the move
* @throws MWException
*/
private function moveToInternal( User $user, &$nt, $reason = '', $createRedirect = true ) {
* @throws MWException
*/
private function moveToInternal( User $user, &$nt, $reason = '', $createRedirect = true ) {
@@
-545,5
+562,7
@@
class MovePage {
# Log the move
$logid = $logEntry->insert();
$logEntry->publish( $logid );
# Log the move
$logid = $logEntry->insert();
$logEntry->publish( $logid );
+
+ return $nullRevision;
}
}
}
}