r75999 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75998‎ | r75999 | r76000 >
Date:13:10, 4 November 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
* (bug 25760) counter property still reported by the API when wgDisableCounters enabled. If it's enabled, don't request counter information, and just display , to avoid breaking any backwards compatability
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -48,10 +48,14 @@
4949 }
5050
5151 public function requestExtraData( $pageSet ) {
 52+ global $wgDisablePageCounters;
 53+
5254 $pageSet->requestField( 'page_restrictions' );
5355 $pageSet->requestField( 'page_is_redirect' );
5456 $pageSet->requestField( 'page_is_new' );
55 - $pageSet->requestField( 'page_counter' );
 57+ if ( $wgDisablePageCounters ) {
 58+ $pageSet->requestField( 'page_counter' );
 59+ }
5660 $pageSet->requestField( 'page_touched' );
5761 $pageSet->requestField( 'page_latest' );
5862 $pageSet->requestField( 'page_len' );
@@ -245,7 +249,12 @@
246250 $this->pageRestrictions = $pageSet->getCustomField( 'page_restrictions' );
247251 $this->pageIsRedir = $pageSet->getCustomField( 'page_is_redirect' );
248252 $this->pageIsNew = $pageSet->getCustomField( 'page_is_new' );
249 - $this->pageCounter = $pageSet->getCustomField( 'page_counter' );
 253+
 254+ global $wgDisablePageCounters;
 255+
 256+ if ( !$wgDisablePageCounters ) {
 257+ $this->pageCounter = $pageSet->getCustomField( 'page_counter' );
 258+ }
250259 $this->pageTouched = $pageSet->getCustomField( 'page_touched' );
251260 $this->pageLatest = $pageSet->getCustomField( 'page_latest' );
252261 $this->pageLength = $pageSet->getCustomField( 'page_len' );
@@ -292,9 +301,13 @@
293302 private function extractPageInfo( $pageid, $title ) {
294303 $pageInfo = array();
295304 if ( $title->exists() ) {
 305+ global $wgDisablePageCounters;
 306+
296307 $pageInfo['touched'] = wfTimestamp( TS_ISO_8601, $this->pageTouched[$pageid] );
297308 $pageInfo['lastrevid'] = intval( $this->pageLatest[$pageid] );
298 - $pageInfo['counter'] = intval( $this->pageCounter[$pageid] );
 309+ $pageInfo['counter'] = $wgDisablePageCounters
 310+ ? ""
 311+ : intval( $this->pageCounter[$pageid] );
299312 $pageInfo['length'] = intval( $this->pageLength[$pageid] );
300313
301314 if ( $this->pageIsRedir[$pageid] ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -487,6 +487,8 @@
488488 * The HTML of diff output markers has changed. Hyphens are now minus signs,
489489 empty markers are now filled with non-breaking-space characters
490490 * (bug 25741) Add more data to list=search's srprop
 491+* (bug 25760) counter property still reported by the API when
 492+ $wgDisableCounters enabled
491493
492494 === Languages updated in 1.17 ===
493495

Follow-up revisions

RevisionCommit summaryAuthorDate
r76000Fixup r75999, add missing ./PhpStorm-98.240/bin/webide.sh Wheee r76000reedy13:20, 4 November 2010
r76152Followup r75999, use the correct variable. Zak confused me with having one th...reedy22:24, 5 November 2010

Comments

#Comment by Platonides (talk | contribs)   22:17, 5 November 2010

There's no $wgDisablePageCounters variable.

Status & tagging log