From b9ca65dc29ab59b7114dc35d8d80187bddb7cad1 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 20 Dec 2005 21:17:03 +0000 Subject: [PATCH] * (bug 3424) Update page_touched for category members on category page creation --- RELEASE-NOTES | 1 + includes/Title.php | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9418f656fa..ec2b42345e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Title.php b/includes/Title.php index 0d5d1c7414..ed8e7f6a4a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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() ), -- 2.20.1