diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2021-09-04 17:20:39 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2023-02-10 20:10:39 +0000 |
commit | 709cf1f41766d31602e67ab9bd74b8633ffef1e7 (patch) | |
tree | 50bb0f18e99039b1904c603cb0db0f834a74cc7b /includes/api/ApiQueryLogEvents.php | |
parent | c1ea8a05df101a8c441b084afe76aa2d0dcdc4ed (diff) | |
download | mediawikicore-709cf1f41766d31602e67ab9bd74b8633ffef1e7.tar.gz mediawikicore-709cf1f41766d31602e67ab9bd74b8633ffef1e7.zip |
api: Include associated rev id of log events in list=logevents
For list=recentchanges the revid is already included with rcprop=ids
Change-Id: I8ee2eed3bf67f8430df63d9e52346b0749418c2e
Diffstat (limited to 'includes/api/ApiQueryLogEvents.php')
-rw-r--r-- | includes/api/ApiQueryLogEvents.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index f3efc0a0abaf..8bf4557d1d54 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -129,7 +129,7 @@ class ApiQueryLogEvents extends ApiQueryBase { [ 'log_namespace', 'log_title' ], $this->fld_title || $this->fld_parsedcomment ); - $this->addFieldsIf( 'log_params', $this->fld_details ); + $this->addFieldsIf( 'log_params', $this->fld_details || $this->fld_ids ); if ( $this->fld_comment || $this->fld_parsedcomment ) { $commentQuery = $this->commentStore->getJoin( 'log_comment' ); @@ -337,6 +337,10 @@ class ApiQueryLogEvents extends ApiQueryBase { if ( $this->fld_ids ) { $vals['pageid'] = (int)$row->page_id; $vals['logpage'] = (int)$row->log_page; + $revId = $logEntry->getAssociatedRevId(); + if ( $revId ) { + $vals['revid'] = (int)$revId; + } } if ( $this->fld_details ) { $vals['params'] = LogFormatter::newFromEntry( $logEntry )->formatParametersForApi(); |