From: Brad Jorsch Date: Thu, 6 Mar 2014 03:57:24 +0000 (-0500) Subject: API: Fix logic for list=recentchanges prop=userid X-Git-Tag: 1.31.0-rc.0~16721^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=6182886b3d60f344e418b92e6a01becaad9f65a0;p=lhc%2Fweb%2Fwiklou.git API: Fix logic for list=recentchanges prop=userid When prop=userid is requested, we need the rc_user field; when prop=user is requested, we need both rc_user and rc_user_text. But for some reason when only prop=userid is requested the code is requesting only rc_user_text and not rc_user. Fix that. Bug: 62301 Change-Id: I86f1f35ebd18e45335cdf43ab3ba0a3e9b0e06b4 --- diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 6ccc2886c4..30dd741026 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -281,8 +281,8 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { /* Add fields to our query if they are specified as a needed parameter. */ $this->addFieldsIf( array( 'rc_this_oldid', 'rc_last_oldid' ), $this->fld_ids ); $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment ); - $this->addFieldsIf( 'rc_user', $this->fld_user ); - $this->addFieldsIf( 'rc_user_text', $this->fld_user || $this->fld_userid ); + $this->addFieldsIf( 'rc_user', $this->fld_user || $this->fld_userid ); + $this->addFieldsIf( 'rc_user_text', $this->fld_user ); $this->addFieldsIf( array( 'rc_minor', 'rc_type', 'rc_bot' ), $this->fld_flags ); $this->addFieldsIf( array( 'rc_old_len', 'rc_new_len' ), $this->fld_sizes ); $this->addFieldsIf( 'rc_patrolled', $this->fld_patrolled );