From 793499cde02f1fc16d15dffa84fa76f1c3f46eb1 Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Wed, 24 Feb 2016 18:50:58 -0500 Subject: [PATCH] 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 --- docs/hooks.txt | 5 +++++ includes/MovePage.php | 3 +++ 2 files changed, 8 insertions(+) diff --git a/docs/hooks.txt b/docs/hooks.txt index 930aa0a84c..8955f54c1a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/MovePage.php b/includes/MovePage.php index 6d69eaa60b..afa4e1cdbb 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -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(); -- 2.20.1