This should fix bug 975072 (Move page doesn't update categories page)
authorMagnus Manske <magnusmanske@users.mediawiki.org>
Fri, 6 Aug 2004 16:25:27 +0000 (16:25 +0000)
committerMagnus Manske <magnusmanske@users.mediawiki.org>
Fri, 6 Aug 2004 16:25:27 +0000 (16:25 +0000)
includes/Title.php

index 03bcf97..b224ad0 100644 (file)
@@ -898,6 +898,14 @@ class Title {
                        $this->moveToNewTitle( $nt, $newid );
                }
 
+
+               # Fixing category links (those without piped 'alternate' names) to be sorted under the new title
+               
+               $dbw =& wfGetDB( DB_MASTER );
+               $sql = "UPDATE categorylinks SET cl_sortkey=\"" . $nt->getPrefixedText() . "\" WHERE cl_from=\"" .$this->getArticleID() . "\" AND cl_sortkey=\"" . $this->getPrefixedText() . "\"" ;
+               $dbw->query( $sql, "SpecialMovepage::doSubmit" );
+               
+
                # Update watchlists
                
                $oldnamespace = $this->getNamespace() & ~1;