From: Aaron Schulz Date: Sat, 17 Jan 2009 18:44:28 +0000 (+0000) Subject: * Added 'target' param to changesfeed to fix total breakage of RCL feed. They were... X-Git-Tag: 1.31.0-rc.0~43375 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=c4b92206fc61177725c548b8ffc7f13aa1fc5e71;p=lhc%2Fweb%2Fwiklou.git * Added 'target' param to changesfeed to fix total breakage of RCL feed. They were all using the same cache so the feed for page X sometimes showed the feed for page Y. * Removed extra constant cache key params * Added feed comments * Fixed tab space --- diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index f3c3e4294f..33a1f05f59 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -18,7 +18,7 @@ class ChangesFeed { $feedTitle, htmlspecialchars( $description ), $wgTitle->getFullUrl() ); } - public function execute( $feed, $rows, $limit = 0 , $hideminor = false, $lastmod = false ) { + public function execute( $feed, $rows, $limit=0, $hideminor=false, $lastmod=false, $target='' ) { global $messageMemc, $wgFeedCacheTimeout; global $wgFeedClasses, $wgSitename, $wgContLanguageCode; @@ -27,7 +27,7 @@ class ChangesFeed { } $timekey = wfMemcKey( $this->type, $this->format, 'timestamp' ); - $key = wfMemcKey( $this->type, $this->format, 'limit', $limit, 'minor', $hideminor ); + $key = wfMemcKey( $this->type, $this->format, $limit, $hideminor, $target ); FeedUtils::checkPurge($timekey, $key); diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 6729c91556..31a1781fe1 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -66,7 +66,8 @@ class SpecialRecentChanges extends SpecialPage { public function feedSetup() { global $wgFeedLimit, $wgRequest; $opts = $this->getDefaultOptions(); - $opts->fetchValuesFromRequest( $wgRequest, array( 'days', 'limit', 'hideminor' ) ); + # Feed is cached on limit,hideminor; other params would randomly not work + $opts->fetchValuesFromRequest( $wgRequest, array( 'limit', 'hideminor' ) ); $opts->validateIntBounds( 'limit', 0, $wgFeedLimit ); return $opts; } @@ -111,10 +112,10 @@ class SpecialRecentChanges extends SpecialPage { } $batch->execute(); } - + $target = isset($opts['target']) ? $opts['target'] : ''; // RCL has targets if( $feedFormat ) { list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat ); - $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod ); + $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod, $target ); } else { $this->webOutput( $rows, $opts ); } diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index c07343540a..1982f232d8 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -22,9 +22,10 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges { $opts['target'] = $par; } - public function feedSetup(){ + public function feedSetup() { global $wgRequest; $opts = parent::feedSetup(); + # Feed is cached on limit,hideminor,target; other params would randomly not work $opts['target'] = $wgRequest->getVal( 'target' ); return $opts; } @@ -133,9 +134,14 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges { } } - $subsql[] = $dbr->selectSQLText( array_merge( $tables, array( $link_table ) ), $select, $conds + $subconds, - __METHOD__, array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ), - $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) ) ); + $subsql[] = $dbr->selectSQLText( + array_merge( $tables, array( $link_table ) ), + $select, + $conds + $subconds, + __METHOD__, + array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ), + $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) ) + ); } if( count($subsql) == 0 )