r60163 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60162‎ | r60163 | r60164 >
Date:15:42, 17 December 2009
Author:happy-melon
Status:resolved (Comments)
Tags:
Comment:
(bug 21535) Add 'namespace' to cache key for RecentChanges RSS feed. Patch by crb, reviewed by Rowan.
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/includes/ChangesFeed.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -72,6 +72,7 @@
7373 * Brent G
7474 * Brianna Laugher
7575 * Carlin
 76+* Crb
7677 * Dan Nessett
7778 * Daniel Arnold
7879 * Denny Vrandecic
Index: trunk/phase3/includes/ChangesFeed.php
@@ -18,7 +18,7 @@
1919 $feedTitle, htmlspecialchars( $description ), $wgTitle->getFullUrl() );
2020 }
2121
22 - public function execute( $feed, $rows, $limit=0, $hideminor=false, $lastmod=false, $target='' ) {
 22+ public function execute( $feed, $rows, $limit=0, $hideminor=false, $namespace='', $lastmod=false, $target='' ) {
2323 global $messageMemc, $wgFeedCacheTimeout;
2424 global $wgSitename, $wgLang;
2525
@@ -27,7 +27,7 @@
2828 }
2929
3030 $timekey = wfMemcKey( $this->type, $this->format, 'timestamp' );
31 - $key = wfMemcKey( $this->type, $this->format, $limit, $hideminor, $target, $wgLang->getCode() );
 31+ $key = wfMemcKey( $this->type, $this->format, $limit, $hideminor, $namespace, $target, $wgLang->getCode() );
3232
3333 FeedUtils::checkPurge($timekey, $key);
3434
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -67,8 +67,8 @@
6868 public function feedSetup() {
6969 global $wgFeedLimit, $wgRequest;
7070 $opts = $this->getDefaultOptions();
71 - # Feed is cached on limit,hideminor; other params would randomly not work
72 - $opts->fetchValuesFromRequest( $wgRequest, array( 'limit', 'hideminor' ) );
 71+ # Feed is cached on limit,hideminor,namespace; other params would randomly not work
 72+ $opts->fetchValuesFromRequest( $wgRequest, array( 'limit', 'hideminor', 'namespace' ) );
7373 $opts->validateIntBounds( 'limit', 0, $wgFeedLimit );
7474 return $opts;
7575 }
@@ -117,7 +117,7 @@
118118 $target = isset($opts['target']) ? $opts['target'] : ''; // RCL has targets
119119 if( $feedFormat ) {
120120 list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat );
121 - $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod, $target );
 121+ $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $opts['namespace'], $lastmod, $target );
122122 } else {
123123 $this->webOutput( $rows, $opts );
124124 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r60176Follow-up to r60163 - add new function parameters at the end of the parameter...happy-melon20:28, 17 December 2009
r62221* Fix for r60163: in RC/RCL, hash together all the options, not just namespac...tstarling04:13, 10 February 2010

Comments

#Comment by Nikerabbit (talk | contribs)   19:52, 17 December 2009

Why namespace instead of any other option? How many options can be added?

#Comment by 😂 (talk | contribs)   20:08, 17 December 2009

Please don't add new parameters in the middle, always add them at the end of the list.

#Comment by Tim Starling (talk | contribs)   06:12, 12 January 2010

Marking fixme due to the unanswered question about other options. They are probably broken, and they should probably be passed in an associative array instead of as separate parameters, since there are so many of them.

Status & tagging log