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

Change subject: Use distinct log actions for patrol
......................................................................


Use distinct log actions for patrol

A distinct log action is provided for automatic patrols.
The old 'auto' param is preserved so that old log entries can still
be correctly identified in logs and API queries.
With I6a61175f9a111c03d15b4d41751c818e3a411ff6, this enables us to
filter new manual patrol entries in logs.
Old automatic entries will be in the wrong list, but still marked
as automatic.

Bug: T27799
Change-Id: I05d962fa3ec45039122bb7e370b7e3fb8bbaa3c8
---
M includes/DefaultSettings.php
M includes/logging/PatrolLog.php
M includes/logging/PatrolLogFormatter.php
M languages/i18n/en.json
M languages/i18n/qqq.json
5 files changed, 17 insertions(+), 4 deletions(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 3b2c697..2aefc64 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -7218,6 +7218,7 @@
        'move/move' => 'MoveLogFormatter',
        'move/move_redir' => 'MoveLogFormatter',
        'patrol/patrol' => 'PatrolLogFormatter',
+       'patrol/autopatrol' => 'PatrolLogFormatter',
        'protect/modify' => 'ProtectLogFormatter',
        'protect/move_prot' => 'ProtectLogFormatter',
        'protect/protect' => 'ProtectLogFormatter',
@@ -7255,6 +7256,10 @@
                'event' => [ 'event' ],
                'revision' => [ 'revision' ],
        ],
+       'patrol' => [
+               'patrol' => [ 'patrol' ],
+               'autopatrol' => [ 'autopatrol' ],
+       ],
        'protect' => [
                'protect' => [ 'protect' ],
                'modify' => [ 'modify' ],
diff --git a/includes/logging/PatrolLog.php b/includes/logging/PatrolLog.php
index f6ecc50..d1de2cd 100644
--- a/includes/logging/PatrolLog.php
+++ b/includes/logging/PatrolLog.php
@@ -58,7 +58,9 @@
                        $user = $wgUser;
                }
 
-               $entry = new ManualLogEntry( 'patrol', 'patrol' );
+               $action = $auto ? 'autopatrol' : 'patrol';
+
+               $entry = new ManualLogEntry( 'patrol', $action );
                $entry->setTarget( $rc->getTitle() );
                $entry->setParameters( self::buildParams( $rc, $auto ) );
                $entry->setPerformer( $user );
diff --git a/includes/logging/PatrolLogFormatter.php 
b/includes/logging/PatrolLogFormatter.php
index e6f9fb6..5b933ce 100644
--- a/includes/logging/PatrolLogFormatter.php
+++ b/includes/logging/PatrolLogFormatter.php
@@ -30,11 +30,11 @@
  */
 class PatrolLogFormatter extends LogFormatter {
        protected function getMessageKey() {
-               $key = parent::getMessageKey();
                $params = $this->getMessageParameters();
                if ( isset( $params[5] ) && $params[5] ) {
-                       // Messages: logentry-patrol-patrol-auto
-                       $key .= '-auto';
+                       $key = 'logentry-patrol-patrol-auto';
+               } else {
+                       $key = 'logentry-patrol-patrol';
                }
 
                return $key;
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 5ae694e..d1f7abc 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -4032,6 +4032,7 @@
        "randomrootpage": "Random root page",
        "log-action-filter-block": "Type of block:",
        "log-action-filter-delete": "Type of deletion:",
+       "log-action-filter-patrol": "Type of patrol:",
        "log-action-filter-protect": "Type of protection:",
        "log-action-filter-upload": "Type of upload:",
        "log-action-filter-all": "All",
@@ -4042,6 +4043,8 @@
        "log-action-filter-delete-restore": "Page undeletion",
        "log-action-filter-delete-event": "Log deletion",
        "log-action-filter-delete-revision": "Revision deletion",
+       "log-action-filter-patrol-patrol": "Manual patrol",
+       "log-action-filter-patrol-autopatrol": "Automatic patrol",
        "log-action-filter-protect-protect": "Protection",
        "log-action-filter-protect-modify": "Protection modification",
        "log-action-filter-protect-unprotect": "Unprotection",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 1c144dd..a8eb696 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -4208,6 +4208,7 @@
        "randomrootpage": "{{doc-special|RandomRootPage}}",
        "log-action-filter-block": "Which type of action to filter for in this 
log",
        "log-action-filter-delete": "Which type of action to filter for in this 
log",
+       "log-action-filter-patrol": "Which type of action to filter for in this 
log",
        "log-action-filter-protect": "Which type of action to filter for in 
this log",
        "log-action-filter-upload": "Which type of action to filter for in this 
log",
        "log-action-filter-all": "All types of action are allowed",
@@ -4218,6 +4219,8 @@
        "log-action-filter-delete-restore": "Action to filter for in this log",
        "log-action-filter-delete-event": "Action to filter for in this log",
        "log-action-filter-delete-revision": "Action to filter for in this log",
+       "log-action-filter-patrol-patrol": "Action to filter for in this log",
+       "log-action-filter-patrol-autopatrol": "Action to filter for in this 
log",
        "log-action-filter-protect-protect": "Action to filter for in this log",
        "log-action-filter-protect-modify": "Action to filter for in this log",
        "log-action-filter-protect-unprotect": "Action to filter for in this 
log",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I05d962fa3ec45039122bb7e370b7e3fb8bbaa3c8
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cenarium <[email protected]>
Gerrit-Reviewer: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Cenarium <[email protected]>
Gerrit-Reviewer: Luke081515 <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to