From: Brion Vibber Date: Sat, 26 Nov 2005 00:54:07 +0000 (+0000) Subject: * (bug 3065) Update both watched namespaces when renaming pages X-Git-Tag: 1.6.0~1132 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=4e3d724dfaf423b0d971490e3e94f659cba13bca;p=lhc%2Fweb%2Fwiklou.git * (bug 3065) Update both watched namespaces when renaming pages --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 72342e408e..ac5112ec77 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -250,6 +250,7 @@ fully support the editing toolbar, but was found to be too confusing. (patch by Joel Nothman) * (bug 4061) Update of Slovene namespace names (LanguageSl.php) * (bug 4064) LanguageDe comma changes +* (bug 3065) Update both watched namespaces when renaming pages === Caveats === diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index 2b01a31bf9..11c6eec3b9 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -133,13 +133,27 @@ class WatchedItem { } /** + * Check if the given title already is watched by the user, and if so + * add watches on a new title. To be used for page renames and such. + * + * @param Title $ot Page title to duplicate entries from, if present + * @param Title $nt Page title to add watches on * @static */ function duplicateEntries( $ot, $nt ) { + WatchedItem::doDuplicateEntries( $ot->getSubjectPage(), $nt->getSubjectPage() ); + WatchedItem::doDuplicateEntries( $ot->getTalkPage(), $nt->getTalkPage() ); + } + + /** + * @static + * @access private + */ + function doDuplicateEntries( $ot, $nt ) { $fname = "WatchedItem::duplicateEntries"; global $wgMemc, $wgDBname; - $oldnamespace = $ot->getNamespace() & ~1; - $newnamespace = $nt->getNamespace() & ~1; + $oldnamespace = $ot->getNamespace(); + $newnamespace = $nt->getNamespace(); $oldtitle = $ot->getDBkey(); $newtitle = $nt->getDBkey();