r82568 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82567‎ | r82568 | r82569 >
Date:19:34, 21 February 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 27611) list=blocks: Use ipb_by_text instead of join with user table

Save a table join when looking up blocks (yay!)

Minor issue, for blocks where users have been renamed, we get their old name (Not a big deal IMHO)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBlocks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryBlocks.php
@@ -72,9 +72,7 @@
7373 $this->addFields( array( 'ipb_address', 'ipb_user' ) );
7474 }
7575 if ( $fld_by ) {
76 - $this->addTables( 'user' );
77 - $this->addFields( array( 'ipb_by', 'user_name' ) );
78 - $this->addWhere( 'user_id = ipb_by' );
 76+ $this->addFields( 'ipb_by_text' );
7977 }
8078 if ( $fld_timestamp ) {
8179 $this->addFields( 'ipb_timestamp' );
@@ -152,7 +150,7 @@
153151 $block['user'] = $row->ipb_address;
154152 }
155153 if ( $fld_by ) {
156 - $block['by'] = $row->user_name;
 154+ $block['by'] = $row->ipb_by_text;
157155 }
158156 if ( $fld_timestamp ) {
159157 $block['timestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
Index: trunk/phase3/RELEASE-NOTES
@@ -177,6 +177,7 @@
178178 * (bug 27479) API error when using both prop=pageprops and
179179 prop=info&inprop=displaytitle
180180 * (bug 27554) Update api information text to reflect change in bug 26125
 181+* (bug 27611) list=blocks: Use ipb_by_text instead of join with user table
181182
182183 === Languages updated in 1.18 ===
183184

Status & tagging log