* (bug 3424) Update page_touched for category members on category page creation
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 20 Dec 2005 21:17:03 +0000 (21:17 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 20 Dec 2005 21:17:03 +0000 (21:17 +0000)
RELEASE-NOTES
includes/Title.php

index 9418f65..ec2b423 100644 (file)
@@ -337,6 +337,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * Removed experimental Amethyst skin from default set
 * Upgrade old skin preferences properly at Special:Preferences
   (used to spontaneously switch to Classic skin for old numeric pref records)
+* (bug 3424) Update page_touched for category members on category page creation
 
 
 === Caveats ===
index 0d5d1c7..ed8e7f6 100644 (file)
@@ -2035,14 +2035,25 @@ class Title {
                                'pl_namespace' => $this->getNamespace(),
                                'pl_title'     => $this->getDbKey() ),
                        $fname );
-               if ( 0 == $dbw->numRows( $res ) ) {
-                       return;
-               }
 
                $toucharr = array();
                while( $row = $dbw->fetchObject( $res ) ) {
                        $toucharr[] = $row->pl_from;
                }
+               $dbw->freeResult( $res );
+               
+               if( $this->getNamespace() == NS_CATEGORY ) {
+                       // Categories show up in a separate set of links as well
+                       $res = $dbw->select( 'categorylinks',
+                               array( 'cl_from' ),
+                               array( 'cl_to' => $this->getDbKey() ),
+                               $fname );
+                       while( $row = $dbw->fetchObject( $res ) ) {
+                               $toucharr[] = $row->cl_from;
+                       }
+                       $dbw->freeResult( $res );
+               }
+               
                if (!count($toucharr))
                        return;
                $dbw->update( 'page', /* SET */ array( 'page_touched' => $dbw->timestamp() ),