* (bug 3065) Update both watched namespaces when renaming pages
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 26 Nov 2005 00:54:07 +0000 (00:54 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 26 Nov 2005 00:54:07 +0000 (00:54 +0000)
RELEASE-NOTES
includes/WatchedItem.php

index 72342e4..ac5112e 100644 (file)
@@ -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 ===
index 2b01a31..11c6eec 100644 (file)
@@ -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();