Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96794
Change subject: Always select ipb_deleted on list=[all]users
......................................................................
Always select ipb_deleted on list=[all]users
When a user with the hideuser permission is using list=[all]users, a
- Notice: Undefined property: stdClass::$ipb_deleted in
\includes\api\ApiQueryUsers.php on line 172
- Notice: Undefined property: stdClass::$ipb_deleted in
\includes\api\ApiQueryAllUsers.php on line 238
can be raised, because the join on the ipblocks table was not done for
the user.
Change-Id: I25ead34b7905e99c249cb05c9d4940195c8b6263
---
M includes/api/ApiQueryAllUsers.php
M includes/api/ApiQueryBase.php
M includes/api/ApiQueryUsers.php
3 files changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/94/96794/1
diff --git a/includes/api/ApiQueryAllUsers.php
b/includes/api/ApiQueryAllUsers.php
index 748dbaf..e68bd18 100644
--- a/includes/api/ApiQueryAllUsers.php
+++ b/includes/api/ApiQueryAllUsers.php
@@ -139,7 +139,7 @@
$this->addWhere( 'user_editcount > 0' );
}
- $this->showHiddenUsersAddBlockInfo( $fld_blockinfo );
+ $this->showHiddenUsersAddBlockInfo( $fld_blockinfo,
'alwaysIpb_deleted' );
if ( $fld_groups || $fld_rights ) {
// Show the groups the given users belong to
diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php
index cfc2244..236230c 100644
--- a/includes/api/ApiQueryBase.php
+++ b/includes/api/ApiQueryBase.php
@@ -544,12 +544,13 @@
* Also adds relevant block information
*
* @param bool $showBlockInfo
+ * @param string $alwaysIpbDeleted Set to 'alwaysIpb_deleted' to select
always ipb_deleted
* @return void
*/
- public function showHiddenUsersAddBlockInfo( $showBlockInfo ) {
+ public function showHiddenUsersAddBlockInfo( $showBlockInfo,
$alwaysIpbDeleted = false ) {
$userCanViewHiddenUsers = $this->getUser()->isAllowed(
'hideuser' );
- if ( $showBlockInfo || !$userCanViewHiddenUsers ) {
+ if ( $showBlockInfo || !$userCanViewHiddenUsers ||
$alwaysIpbDeleted === 'alwaysIpb_deleted' ) {
$this->addTables( 'ipblocks' );
$this->addJoinConds( array(
'ipblocks' => array( 'LEFT JOIN',
'ipb_user=user_id' ),
diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php
index cd4a8fc..a406540 100644
--- a/includes/api/ApiQueryUsers.php
+++ b/includes/api/ApiQueryUsers.php
@@ -112,7 +112,7 @@
$this->addFields( User::selectFields() );
$this->addWhereFld( 'user_name', $goodNames );
- $this->showHiddenUsersAddBlockInfo( isset(
$this->prop['blockinfo'] ) );
+ $this->showHiddenUsersAddBlockInfo( isset(
$this->prop['blockinfo'] ), 'alwaysIpb_deleted' );
$data = array();
$res = $this->select( __METHOD__ );
--
To view, visit https://gerrit.wikimedia.org/r/96794
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I25ead34b7905e99c249cb05c9d4940195c8b6263
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits