Mattflaschen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/273535

Change subject: Add TitleMoveStarting, mirroring TitleMoveCompleting
......................................................................

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
(cherry picked from commit 793499cde02f1fc16d15dffa84fa76f1c3f46eb1)
---
M docs/hooks.txt
M includes/MovePage.php
2 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/273535/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index 8822e0c..a8f44ec 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3065,6 +3065,11 @@
 $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 fb0ca8c..eb66bc9 100644
--- a/includes/MovePage.php
+++ b/includes/MovePage.php
@@ -248,6 +248,9 @@
                }
 
                $dbw->startAtomic( __METHOD__ );
+
+               Hooks::run( 'TitleMoveStarting', [ $this->oldTitle, 
$this->newTitle, $user ] );
+
                $pageid = $this->oldTitle->getArticleID( Title::GAID_FOR_UPDATE 
);
                $protected = $this->oldTitle->isProtected();
 

-- 
To view, visit https://gerrit.wikimedia.org/r/273535
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie772f737f917854e4cfefe52ec3bea4669c9efe0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.14
Gerrit-Owner: Mattflaschen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to