Add TitleMoveStarting, mirroring TitleMoveCompleting

This is a pre-requisite to fix a Flow move regression, T127785.

This allows running an atomic entirely within the move with the correct
ordering.

Bug: T127785
Change-Id: Ie772f737f917854e4cfefe52ec3bea4669c9efe0
This commit is contained in:
Matthew Flaschen 2016-02-24 18:50:58 -05:00
parent 8e6154c878
commit 793499cde0
2 changed files with 8 additions and 0 deletions

View file

@ -3066,6 +3066,11 @@ $old: old title
$nt: new title
$user: user who does the move
'TitleMoveStarting': Before moving an article (title), but just after the atomic DB section starts.
$old: old title
$nt: new title
$user: user who does the move
'TitleMoveComplete': After moving an article (title), post-commit.
&$old: old title
&$nt: new title

View file

@ -248,6 +248,9 @@ class MovePage {
}
$dbw->startAtomic( __METHOD__ );
Hooks::run( 'TitleMoveStarting', [ $this->oldTitle, $this->newTitle, $user ] );
$pageid = $this->oldTitle->getArticleID( Title::GAID_FOR_UPDATE );
$protected = $this->oldTitle->isProtected();