* (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
* (bug 27616) Add userid of blocked user and blocker to list=blocks
+* (bug 27688) Simplify queries to list user block information
=== Languages updated in 1.18 ===
if ( $fld_blockinfo ) {
$this->addTables( 'ipblocks' );
- $this->addTables( 'user', 'u2' );
- $u2 = $this->getAliasedName( 'user', 'u2' );
$this->addJoinConds( array(
'ipblocks' => array( 'LEFT JOIN', 'ipb_user=u1.user_id' ),
- $u2 => array( 'LEFT JOIN', 'ipb_by=u2.user_id' ) ) );
- $this->addFields( array( 'ipb_reason', 'u2.user_name AS blocker_name' ) );
+ ) );
+ $this->addFields( array( 'ipb_reason', 'ipb_by_text', 'ipb_expiry' ) );
}
$this->addOption( 'LIMIT', $sqlLimit );
'name' => $lastUser,
'userid' => $row->user_id,
);
- if ( $fld_blockinfo && !is_null( $row->blocker_name ) ) {
- $lastUserData['blockedby'] = $row->blocker_name;
+ if ( $fld_blockinfo && !is_null( $row->ipb_by_text ) ) {
+ $lastUserData['blockedby'] = $row->ipb_by_text;
$lastUserData['blockreason'] = $row->ipb_reason;
+ $lastUserData['blockexpiry'] = $row->ipb_expiry;
}
if ( $fld_editcount ) {
$lastUserData['editcount'] = intval( $row->user_editcount );
}
if ( isset( $this->prop['blockinfo'] ) ) {
$this->addTables( 'ipblocks' );
- $this->addTables( 'user', 'u2' );
- $u2 = $this->getAliasedName( 'user', 'u2' );
$this->addJoinConds( array(
'ipblocks' => array( 'LEFT JOIN', 'ipb_user=u1.user_id' ),
- $u2 => array( 'LEFT JOIN', 'ipb_by=u2.user_id' ) ) );
- $this->addFields( array( 'ipb_reason', 'u2.user_name AS blocker_name', 'ipb_expiry' ) );
+ ) );
+ $this->addFields( array( 'ipb_reason', 'ipb_by_text', 'ipb_expiry' ) );
}
$data = array();
}
if ( isset( $this->prop['blockinfo'] ) && !is_null( $row->blocker_name ) ) {
- $data[$name]['blockedby'] = $row->blocker_name;
+ $data[$name]['blockedby'] = $row->ipb_by_text;
$data[$name]['blockreason'] = $row->ipb_reason;
$data[$name]['blockexpiry'] = $row->ipb_expiry;
}