r73652 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73651‎ | r73652 | r73653 >
Date:13:00, 24 September 2010
Author:gurch
Status:ok (Comments)
Tags:
Comment:
API: sinumberingroup now gives correct size of 'user' group, and omits size of implicit groups rather than showing 0.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -331,8 +331,17 @@
332332 'name' => $group,
333333 'rights' => array_keys( $permissions, true ),
334334 );
 335+
335336 if ( $numberInGroup ) {
336 - $arr['number'] = SiteStats::numberInGroup( $group );
 337+ global $wgAutopromote;
 338+
 339+ if ($group == 'user') {
 340+ $arr['number'] = SiteStats::users();
 341+
 342+ // '*' and autopromote groups have no size
 343+ } elseif (!($group == '*' || in_array($group, array_keys($wgAutopromote)))) {
 344+ $arr['number'] = SiteStats::numberInGroup( $group );
 345+ }
337346 }
338347
339348 $groupArr = array(
Index: trunk/phase3/RELEASE-NOTES
@@ -400,6 +400,8 @@
401401 * (bug 24166) API error when using rvprop=tags
402402 * Introduced "asynchronous download" mode for upload-by-url. Requires
403403 $wgAllowAsyncCopyUploads to be true.
 404+* sinumberingroup correctly gives size of 'user' group, and omits size of
 405+ implicit groups rather than showing 0.
404406
405407 === Languages updated in 1.17 ===
406408

Follow-up revisions

RevisionCommit summaryAuthorDate
r73659reimplement r73652 having actually read coding conventions this timegurch14:40, 24 September 2010

Comments

#Comment by Nikerabbit (talk | contribs)   13:49, 24 September 2010

Spacing does not follow coding conventions. The condition could be simplified to $group !== '*' && !isset( $wgAutopromote[$group] )

Status & tagging log