From: Sam Reed Date: Mon, 21 Feb 2011 19:34:57 +0000 (+0000) Subject: * (bug 27611) list=blocks: Use ipb_by_text instead of join with user table X-Git-Tag: 1.31.0-rc.0~31841 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=67a4be48663d5552ef5273ca7a3dc8e736fe7c9f;p=lhc%2Fweb%2Fwiklou.git * (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) --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5aaffaa07b..81147ad439 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -177,6 +177,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 27479) API error when using both prop=pageprops and prop=info&inprop=displaytitle * (bug 27554) Update api information text to reflect change in bug 26125 +* (bug 27611) list=blocks: Use ipb_by_text instead of join with user table === Languages updated in 1.18 === diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index 1563f48bc9..80940d5fa1 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -72,9 +72,7 @@ class ApiQueryBlocks extends ApiQueryBase { $this->addFields( array( 'ipb_address', 'ipb_user' ) ); } if ( $fld_by ) { - $this->addTables( 'user' ); - $this->addFields( array( 'ipb_by', 'user_name' ) ); - $this->addWhere( 'user_id = ipb_by' ); + $this->addFields( 'ipb_by_text' ); } if ( $fld_timestamp ) { $this->addFields( 'ipb_timestamp' ); @@ -152,7 +150,7 @@ class ApiQueryBlocks extends ApiQueryBase { $block['user'] = $row->ipb_address; } if ( $fld_by ) { - $block['by'] = $row->user_name; + $block['by'] = $row->ipb_by_text; } if ( $fld_timestamp ) { $block['timestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );