jenkins-bot has submitted this change and it was merged. Change subject: Introduce separate log action for deleting pages on move ......................................................................
Introduce separate log action for deleting pages on move Since T106119, moves that overwrite a redirect produce a deletion log entry. It should be possibleto identify such deletions within other ones. Note that this patch only applies for actions in the future because there is no way to easily identify these cases for the software (until now). Bug: T145991 Change-Id: I3c006bca57351d82031c4fdce0c53f65d630b0d9 --- M includes/DefaultSettings.php M includes/MovePage.php M includes/changes/RecentChange.php M includes/logging/DeleteLogFormatter.php M includes/page/WikiPage.php M languages/i18n/en.json M languages/i18n/qqq.json 7 files changed, 13 insertions(+), 3 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 9d8ccf8..8f34e59 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -7510,6 +7510,7 @@ 'contentmodel/change' => 'ContentModelLogFormatter', 'contentmodel/new' => 'ContentModelLogFormatter', 'delete/delete' => 'DeleteLogFormatter', + 'delete/delete_redir' => 'DeleteLogFormatter', 'delete/event' => 'DeleteLogFormatter', 'delete/restore' => 'DeleteLogFormatter', 'delete/revision' => 'DeleteLogFormatter', @@ -7561,6 +7562,7 @@ ], 'delete' => [ 'delete' => [ 'delete' ], + 'delete_redir' => [ 'delete_redir' ], 'restore' => [ 'restore' ], 'event' => [ 'event' ], 'revision' => [ 'revision' ], diff --git a/includes/MovePage.php b/includes/MovePage.php index a8f6f8e..cbb4651 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -457,7 +457,9 @@ $nt->getArticleID(), /* $commit */ false, $errs, - $user + $user, + [], + 'delete_redir' ); if ( !$status->isGood() ) { diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 1262f2c..81f64a8 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -762,6 +762,7 @@ # # Get pageStatus for email notification switch ( $type . '-' . $action ) { case 'delete-delete': + case 'delete-delete_redir': $pageStatus = 'deleted'; break; case 'move-move': diff --git a/includes/logging/DeleteLogFormatter.php b/includes/logging/DeleteLogFormatter.php index c205626..dc9378f 100644 --- a/includes/logging/DeleteLogFormatter.php +++ b/includes/logging/DeleteLogFormatter.php @@ -122,6 +122,7 @@ switch ( $this->entry->getSubtype() ) { case 'delete': // Show undelete link + case 'delete_redir': if ( $user->isAllowed( 'undelete' ) ) { $message = 'undeletelink'; } else { diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index a5ac78f..4a81bb3 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2861,7 +2861,7 @@ */ public function doDeleteArticleReal( $reason, $suppress = false, $u1 = null, $u2 = null, &$error = '', User $user = null, - $tags = [] + $tags = [], $logsubtype = 'delete' ) { global $wgUser, $wgContentHandlerUseDB; @@ -2992,7 +2992,7 @@ // Log the deletion, if the page was suppressed, put it in the suppression log instead $logtype = $suppress ? 'suppress' : 'delete'; - $logEntry = new ManualLogEntry( $logtype, 'delete' ); + $logEntry = new ManualLogEntry( $logtype, $logsubtype ); $logEntry->setPerformer( $user ); $logEntry->setTarget( $logTitle ); $logEntry->setComment( $reason ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index a033edd..d8913c0 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -3825,6 +3825,7 @@ "htmlform-user-not-valid": "<strong>$1</strong> isn't a valid username.", "rawmessage": "$1", "logentry-delete-delete": "$1 {{GENDER:$2|deleted}} page $3", + "logentry-delete-delete_redir": "$1 {{GENDER:$2|deleted}} redirect $3 by overwriting", "logentry-delete-restore": "$1 {{GENDER:$2|restored}} page $3", "logentry-delete-event": "$1 {{GENDER:$2|changed}} visibility of {{PLURAL:$5|a log event|$5 log events}} on $3: $4", "logentry-delete-revision": "$1 {{GENDER:$2|changed}} visibility of {{PLURAL:$5|a revision|$5 revisions}} on page $3: $4", @@ -4130,6 +4131,7 @@ "log-action-filter-contentmodel-change": "Change of Contentmodel", "log-action-filter-contentmodel-new": "Creation of page with non-standard Contentmodel", "log-action-filter-delete-delete": "Page deletion", + "log-action-filter-delete-delete_redir": "Redirect overwrite", "log-action-filter-delete-restore": "Page undeletion", "log-action-filter-delete-event": "Log deletion", "log-action-filter-delete-revision": "Revision deletion", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 8e2b441..4a90c98 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -4009,6 +4009,7 @@ "htmlform-user-not-valid": "Error message shown if the name provided by the user isn't a valid username. $1 is the username.", "rawmessage": "{{notranslate}} Used to pass arbitrary text as a message specifier array", "logentry-delete-delete": "{{Logentry|[[Special:Log/delete]]}}", + "logentry-delete-delete_redir": "{{Logentry|[[Special:Log/delete]]}}", "logentry-delete-restore": "{{Logentry|[[Special:Log/delete]]}}", "logentry-delete-event": "{{Logentry|[[Special:Log/delete]]}}\n{{Logentryparam}}\n* $5 - count of affected log events", "logentry-delete-revision": "{{Logentry|[[Special:Log/delete]]}}\n{{Logentryparam}}\n* $5 - the number of affected revisions of the page $3", @@ -4314,6 +4315,7 @@ "log-action-filter-contentmodel-change": "{{doc-log-action-filter-action|contentmodel|change}}", "log-action-filter-contentmodel-new": "{{doc-log-action-filter-action|contentmodel|new}}", "log-action-filter-delete-delete": "{{doc-log-action-filter-action|delete|delete}}", + "log-action-filter-delete-delete_redir": "{{doc-log-action-filter-action|delete|delete_redir}}", "log-action-filter-delete-restore": "{{doc-log-action-filter-action|delete|restore}}", "log-action-filter-delete-event": "{{doc-log-action-filter-action|delete|event}}", "log-action-filter-delete-revision": "{{doc-log-action-filter-action|delete|revision}}", -- To view, visit https://gerrit.wikimedia.org/r/320782 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3c006bca57351d82031c4fdce0c53f65d630b0d9 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: MGChecker <hgasu...@gmail.com> Gerrit-Reviewer: Chad <ch...@wikimedia.org> Gerrit-Reviewer: Luke081515 <luke081...@web.de> Gerrit-Reviewer: MGChecker <hgasu...@gmail.com> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: Raimond Spekking <raimond.spekk...@gmail.com> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits