r97033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97032‎ | r97033 | r97034 >
Date:00:42, 14 September 2011
Author:sean_colombo
Status:resolved (Comments)
Tags:todo 
Comment:
Merged wgWhatlinkshereLimit from Wikia. It defaults to the same value it was hardcoded to before.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -3799,6 +3799,12 @@
38003800 $wgPutIPinRC = true;
38013801
38023802 /**
 3803+ * Integer defining default number of entries to show on
 3804+ * Special:Whatlinkshere
 3805+ */
 3806+$wgWhatlinkshereLimit = 50;
 3807+
 3808+/**
38033809 * Limit password attempts to X attempts per Y seconds per IP per account.
38043810 * Requires memcached.
38053811 */
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -47,6 +47,7 @@
4848 }
4949
5050 function execute( $par ) {
 51+ global $wgWhatlinkshereLimit;
5152 $out = $this->getOutput();
5253
5354 $this->setHeaders();
@@ -55,7 +56,7 @@
5657
5758 $opts->add( 'target', '' );
5859 $opts->add( 'namespace', '', FormOptions::INTNULL );
59 - $opts->add( 'limit', 50 );
 60+ $opts->add( 'limit', $wgWhatlinkshereLimit );
6061 $opts->add( 'from', 0 );
6162 $opts->add( 'back', 0 );
6263 $opts->add( 'hideredirs', false );

Follow-up revisions

RevisionCommit summaryAuthorDate
r100761Followup to r97033 - removed wgWhatlinksherelimit and started the conversion ...sean_colombo23:18, 25 October 2011

Comments

#Comment by Krinkle (talk | contribs)   00:56, 14 September 2011

There's over a dozen of other special pages that are also showing lists of links ("QueryPage"). Those all share a common limit (50 as well). Perhaps make a configuration option for that instead just this local variable (eg. $wgQueryPageDefaultLimit) and use it here in SpecialWhatlinkshere.


I'm not sure we should have a specific limit like this just for SpecialWhatlinkshere.

#Comment by SColombo~mediawikiwiki (talk | contribs)   01:42, 14 September 2011

$wgQueryPageDefaultLimit does sound like a good idea.

#Comment by Krinkle (talk | contribs)   21:23, 25 October 2011

Reminder.

#Comment by SColombo~mediawikiwiki (talk | contribs)   23:19, 25 October 2011

Changed the var name, but only found one other special (SpecialDeletedContributions) which had a limit of 50 hardcoded in for a default.

Where did you find which special pages were using a default limit?

#Comment by SColombo~mediawikiwiki (talk | contribs)   23:19, 25 October 2011

(i grepped in /includes/specials for "50")

#Comment by Krinkle (talk | contribs)   17:38, 26 October 2011

Although I haven't deeply investigated if all of these should use the new wgQueryPageDefaultLimit:

  • QueryPage::doFeed( $limit = 50
  • $wgFeedLimit = 50;
  • wfCheckLimits( $deflimit = 50
  • Pager { var $mDefaultLimit = 50;
  • WebRequest::getLimitOffset( $deflimit = 50


(phase3:$ ack '50;' includes; phase3:$ ack ' = 50' includes)

Status & tagging log