jenkins-bot has submitted this change and it was merged.

Change subject: Make list=logevents display log entries by anonymous users
......................................................................


Make list=logevents display log entries by anonymous users

Also fix warnings being shown and "anon" property being given to non-anon 
entries
when "userid" leprop was used but no "user".

Bug: 50315
Change-Id: I4df1c8c1040fb39d75ead5851d42b02d9de87a5a
---
M RELEASE-NOTES-1.22
M includes/api/ApiQueryLogEvents.php
2 files changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index ca653ef..8074db7 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -156,6 +156,7 @@
   requested.
 * Special:Recentchangeslinked will now include upload log entries
 * (bug 41281) Fixed ugly output if file size could not be extracted for 
multi-page media.
+* (bug 50315) list=logevents API module will now output log entries by 
anonymous users.
 
 === API changes in 1.22 ===
 * (bug 25553) The JSON output formatter now leaves forward slashes unescaped
diff --git a/includes/api/ApiQueryLogEvents.php 
b/includes/api/ApiQueryLogEvents.php
index 2aa5c28..96d02da 100644
--- a/includes/api/ApiQueryLogEvents.php
+++ b/includes/api/ApiQueryLogEvents.php
@@ -67,7 +67,7 @@
                $this->addTables( array( 'logging', 'user', 'page' ) );
                $this->addOption( 'STRAIGHT_JOIN' );
                $this->addJoinConds( array(
-                       'user' => array( 'JOIN',
+                       'user' => array( 'LEFT JOIN',
                                'user_id=log_user' ),
                        'page' => array( 'LEFT JOIN',
                                array( 'log_namespace=page_namespace',
@@ -82,8 +82,8 @@
                ) );
 
                $this->addFieldsIf( array( 'log_id', 'page_id' ), 
$this->fld_ids );
-               $this->addFieldsIf( array( 'log_user', 'user_name' ), 
$this->fld_user );
-               $this->addFieldsIf( 'user_id', $this->fld_userid );
+               $this->addFieldsIf( array( 'log_user', 'log_user_text', 
'user_name' ), $this->fld_user );
+               $this->addFieldsIf( 'log_user', $this->fld_userid );
                $this->addFieldsIf( array( 'log_namespace', 'log_title' ), 
$this->fld_title || $this->fld_parsedcomment );
                $this->addFieldsIf( 'log_comment', $this->fld_comment || 
$this->fld_parsedcomment );
                $this->addFieldsIf( 'log_params', $this->fld_details );
@@ -336,10 +336,10 @@
                                $vals['userhidden'] = '';
                        } else {
                                if ( $this->fld_user ) {
-                                       $vals['user'] = $row->user_name;
+                                       $vals['user'] = $row->user_name === 
null ? $row->log_user_text : $row->user_name;
                                }
                                if ( $this->fld_userid ) {
-                                       $vals['userid'] = $row->user_id;
+                                       $vals['userid'] = $row->log_user;
                                }
 
                                if ( !$row->log_user ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/71184
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4df1c8c1040fb39d75ead5851d42b02d9de87a5a
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to