jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384496 )

Change subject: Actually mark abusefilter creations as such in the AbuseFilter 
log
......................................................................


Actually mark abusefilter creations as such in the AbuseFilter log

Bug: T178283
Co-Authored-By: Matěj Suchánek <[email protected]>
Change-Id: I89776eff2fc420b1fe3e2c3b88671749fadb57b4
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/AbuseFilterModifyLogFormatter.php
M includes/Views/AbuseFilterViewEdit.php
5 files changed, 27 insertions(+), 3 deletions(-)

Approvals:
  Huji: Looks good to me, but someone else must approve
  Matěj Suchánek: Looks good to me, but someone else must approve
  20after4: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index f4f3c7c..3003772 100644
--- a/extension.json
+++ b/extension.json
@@ -46,7 +46,18 @@
        },
        "LogActionsHandlers": {
                "abusefilter/hit": "AbuseLogHitFormatter",
-               "abusefilter/modify": "AbuseFilterModifyLogFormatter"
+               "abusefilter/modify": "AbuseFilterModifyLogFormatter",
+               "abusefilter/create": "AbuseFilterModifyLogFormatter"
+       },
+       "ActionFilteredLogs": {
+               "abusefilter": {
+                       "modify": [
+                               "modify"
+                       ],
+                       "create": [
+                               "create"
+                       ]
+               }
        },
        "APIModules": {
                "abusefilterchecksyntax": "ApiAbuseFilterCheckSyntax",
diff --git a/i18n/en.json b/i18n/en.json
index 1a6ccf5..3631a26 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -84,6 +84,9 @@
        "abusefilter-logentry-suppress": "hid \"[[$1]]\"",
        "abusefilter-logentry-unsuppress": "unhid \"[[$1]]\"",
        "logentry-abusefilter-hit": "$1 {{GENDER:$2|triggered}} $4, 
{{GENDER:$2|performing}} the action \"$5\" on $3. Actions taken: $6 ($7)",
+       "log-action-filter-abusefilter": "Type of filter change:",
+       "log-action-filter-abusefilter-create": "New filter creation",
+       "log-action-filter-abusefilter-modify": "Filter modification",
        "abusefilter-management": "Abuse filter management",
        "abusefilter-list": "All filters",
        "abusefilter-list-id": "Filter ID",
@@ -397,6 +400,7 @@
        "abusefilter-topnav-import": "Import filter",
        "abusefilter-log-name": "Abuse filter log",
        "abusefilter-log-header": "This log shows a summary of changes made to 
filters.\nFor full details, see [[Special:AbuseFilter/history|the list]] of 
recent filter changes.",
+       "abusefilter-logentry-create": "$1 {{GENDER:$2|created}} $4 ($5)",
        "abusefilter-logentry-modify": "$1 {{GENDER:$2|modified}} $4 ($5)",
        "abusefilter-log-noresults": "No results",
        "abusefilter-diff-title": "Differences between versions",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 522cc1b..2ca993a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -115,6 +115,9 @@
        "abusefilter-logentry-suppress": "Log entry when hiding an abuse filter 
log entry. Parameters:\n* $1 is a link to the log ID with the log ID as 
description.",
        "abusefilter-logentry-unsuppress": "Log entry when unhiding an abuse 
filter log entry. Parameters:\n* $1 is a link to the log ID with the log ID as 
description.",
        "logentry-abusefilter-hit": "This message is for a log entry. 
Parameters:\n* $1 - user who performed the action\n* $2 - user who performed 
the action (to be used with GENDER)\n* $3 - link to the page, that the action 
that triggered the filter was made on\n* $4 - link to filter\n* $5 - action by 
user, like 'edit', 'move', 'create' etc.\n* $6 - actions taken by the filter\n* 
$7 - action details link",
+       "log-action-filter-abusefilter": 
"{{doc-log-action-filter-action|abusefilter}}",
+       "log-action-filter-abusefilter-create": 
"{{doc-log-action-filter-action|abusefilter|create}}",
+       "log-action-filter-abusefilter-modify": 
"{{doc-log-action-filter-action|abusefilter|modify}}",
        "abusefilter-management": "Title of [[Special:AbuseFilter]]",
        "abusefilter-list": "Used as HTML <code><nowiki><h2></nowiki></code> 
heading.\n\nFollowed by the fieldset label 
{{msg-mw|Abusefilter-list-options}}.",
        "abusefilter-list-id": "Column header in abuse filter overview for the 
filter identifier.\n{{Identical|Filter ID}}",
@@ -428,6 +431,7 @@
        "abusefilter-topnav-import": "Used as link text in the navigation 
toolbar.\n\nThe link points to [[Special:AbuseLog]].",
        "abusefilter-log-name": "{{doc-logpage}}",
        "abusefilter-log-header": "Used as description on 
[[Special:Log/abusefilter]]",
+       "abusefilter-logentry-create": "Parameters:\n* $1 - a link to a user 
page with a user name as link text, followed by a series of related links\n* $2 
- raw username, for GENDER support\n* $3 - (unused)\n* $4 - text 
{{msg-mw|abusefilter-log-detailedentry-local}} linked to the filter created\n* 
$5 - text {{msg-mw|abusefilter-log-detailslink}} linked to the filter change 
details",
        "abusefilter-logentry-modify": "Parameters:\n* $1 - a link to a user 
page with a user name as link text, followed by a series of related links\n* $2 
- raw username, for GENDER support\n* $3 - (unused)\n* $4 - text 
{{msg-mw|abusefilter-log-detailedentry-local}} linked to the modified filter\n* 
$5 - text {{msg-mw|abusefilter-log-detailslink}} linked to the filter change 
details",
        "abusefilter-log-noresults": "{{Identical|No result}}",
        "abusefilter-diff-title": "Similar to {{msg-mw|Difference}}",
diff --git a/includes/AbuseFilterModifyLogFormatter.php 
b/includes/AbuseFilterModifyLogFormatter.php
index 3a55314..769c27d 100644
--- a/includes/AbuseFilterModifyLogFormatter.php
+++ b/includes/AbuseFilterModifyLogFormatter.php
@@ -6,7 +6,11 @@
         * @return string
         */
        protected function getMessageKey() {
-               return 'abusefilter-logentry-modify';
+               $subtype = $this->entry->getSubtype();
+               // Messages that can be used here:
+               // * abusefilter-logentry-create
+               // * abusefilter-logentry-modify
+               return "abusefilter-logentry-$subtype";
        }
 
        /**
diff --git a/includes/Views/AbuseFilterViewEdit.php 
b/includes/Views/AbuseFilterViewEdit.php
index 50c9769..8ec79da 100644
--- a/includes/Views/AbuseFilterViewEdit.php
+++ b/includes/Views/AbuseFilterViewEdit.php
@@ -300,7 +300,8 @@
                        }
 
                        // Logging
-                       $logEntry = new ManualLogEntry( 'abusefilter', 'modify' 
);
+                       $subtype = $filter === 'new' ? 'create' : 'modify';
+                       $logEntry = new ManualLogEntry( 'abusefilter', $subtype 
);
                        $logEntry->setPerformer( $user );
                        $logEntry->setTarget( $this->getTitle( $new_id ) );
                        $logEntry->setParameters( [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I89776eff2fc420b1fe3e2c3b88671749fadb57b4
Gerrit-PatchSet: 14
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio <[email protected]>
Gerrit-Reviewer: 20after4 <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Huji <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MarcoAurelio <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[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