Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/117041

Change subject: Remove wildcard actions from list=logevents&leaction=
......................................................................

Remove wildcard actions from list=logevents&leaction=

The documentation of leaction= shows actions like "thanks/*", but that
will result in a search for log_action='*' which gives always a empty
result.

Needs a way to get the full list of actions or a deprecation of the
wildcard actions entries in the action log handler array. See also bug
61834. The logs with wildcard action entries at the moment
only filterable by type.

Change-Id: Ia77e499909ce6f25ce74617367fc5b622ea9a7c9
---
M includes/api/ApiQueryLogEvents.php
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/41/117041/1

diff --git a/includes/api/ApiQueryLogEvents.php 
b/includes/api/ApiQueryLogEvents.php
index 848c6ce..c6e7573 100644
--- a/includes/api/ApiQueryLogEvents.php
+++ b/includes/api/ApiQueryLogEvents.php
@@ -423,6 +423,16 @@
        public function getAllowedParams() {
                global $wgLogTypes, $wgLogActions, $wgLogActionsHandlers;
 
+               $actions = array_keys( $wgLogActions );
+               // Remove wildcard actions, searching for log_action='*' will 
always give a empty result
+               foreach ( $wgLogActionsHandlers as $action => $handler ) {
+                       if ( substr( $action, -2 ) !== '/*' ) {
+                               $actions[] = $action;
+                       }
+               }
+               // TODO: Add all possible actions, also actions which are 
descriped by wildcards (bug 61834).
+               // The log actions at the moment only filterable by type
+
                return array(
                        'prop' => array(
                                ApiBase::PARAM_ISMULTI => true,
@@ -444,7 +454,7 @@
                                ApiBase::PARAM_TYPE => $wgLogTypes
                        ),
                        'action' => array(
-                               ApiBase::PARAM_TYPE => array_keys( array_merge( 
$wgLogActions, $wgLogActionsHandlers ) )
+                               ApiBase::PARAM_TYPE => $actions
                        ),
                        'start' => array(
                                ApiBase::PARAM_TYPE => 'timestamp'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia77e499909ce6f25ce74617367fc5b622ea9a7c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to