Page MenuHomePhabricator

Simplify queries to list user block information
Closed, ResolvedPublic


Same as bug 27611:

Use field ipb_by_text of table ipblocks instead of a join with the user table to get the "blocker_name".


Version: 1.18.x
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:33 PM
bzimport set Reference to bz27688.

I was thinking I'd already done this one, slightly confusing

		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' ) );

Just a case of simplifying that, and not having the 2nd join of the user table in :)

year, "Mid-air collision detected!" - Edit conflict in bugzilla

Also for list=users&usprop=blockinfo.


Done both in r82739, some simplfication in r82740

Also in r82739, I've exposed the block expiry information on list=users, was already there in list=allusers