diff options
author | Brion Vibber <brion@users.mediawiki.org> | 2005-12-20 21:17:03 +0000 |
---|---|---|
committer | Brion Vibber <brion@users.mediawiki.org> | 2005-12-20 21:17:03 +0000 |
commit | b9ca65dc29ab59b7114dc35d8d80187bddb7cad1 (patch) | |
tree | b42d2fa616912bd52ee7be66a99ae55256b63978 | |
parent | d90e03ae6648e4b85b163d78cc0043557868b7ca (diff) | |
download | mediawikicore-b9ca65dc29ab59b7114dc35d8d80187bddb7cad1.tar.gz mediawikicore-b9ca65dc29ab59b7114dc35d8d80187bddb7cad1.zip |
* (bug 3424) Update page_touched for category members on category page creation
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/12169
-rw-r--r-- | RELEASE-NOTES | 1 | ||||
-rw-r--r-- | includes/Title.php | 17 |
2 files changed, 15 insertions, 3 deletions
diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9418f656fa01..ec2b42345e41 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 0d5d1c74147b..ed8e7f6a4aa6 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() ), |