J has uploaded a new change for review.
https://gerrit.wikimedia.org/r/83995
Change subject: Add TitleMove hook
......................................................................
Add TitleMove hook
some things need access to the old file before its moved,
adding hook to allow extensions to do something before
file is moved.
Change-Id: Ic5e659abc79c41e3331d42074e7f21eec9b9ba7c
---
M HISTORY
M docs/hooks.txt
M includes/Title.php
3 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/95/83995/1
diff --git a/HISTORY b/HISTORY
index 45eab2e..8cb4539 100644
--- a/HISTORY
+++ b/HISTORY
@@ -122,6 +122,7 @@
correctly.
* (bug 45803) Whitespace within == Headline == syntax and within <hN> headings
is now non-significant and not preserved in the HTML output.
+* Add TitleMove hook before page renames
=== Bug fixes in 1.21 ===
* (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 02413b3..5d6a6e4 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -2419,6 +2419,11 @@
Hooks may change this value to override the return value of
Title::isWikitextPage()
+'TitleMove': Before moving an article (title).
+$old: old title
+$nt: new title
+$user: user who does the move
+
'TitleMoveComplete': After moving an article (title).
$old: old title
$nt: new title
diff --git a/includes/Title.php b/includes/Title.php
index 734e009..0a91884 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -3620,6 +3620,8 @@
$createRedirect = true;
}
+ wfRunHooks( 'TitleMove', array( &$this, &$nt, &$wgUser ) );
+
// If it is a file, move it first.
// It is done before all other moving stuff is done because
it's hard to revert.
$dbw = wfGetDB( DB_MASTER );
--
To view, visit https://gerrit.wikimedia.org/r/83995
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5e659abc79c41e3331d42074e7f21eec9b9ba7c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: J <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits