Merge "Tag deletion logs performed with Nuke"

This commit is contained in:
jenkins-bot 2024-10-22 03:38:45 +00:00 committed by Gerrit Code Review
commit dd5715525e
4 changed files with 16 additions and 3 deletions

View file

@ -25,7 +25,9 @@
}
},
"Hooks": {
"ContributionsToolLinks": "main"
"ContributionsToolLinks": "main",
"ListDefinedTags": "MediaWiki\\Extension\\Nuke\\Hooks::onRegisterTags",
"ChangeTagsListActive": "MediaWiki\\Extension\\Nuke\\Hooks::onRegisterTags"
},
"ResourceModules": {
"ext.nuke.confirm": {

View file

@ -31,4 +31,14 @@ class Hooks implements ContributionsToolLinksHook {
);
}
}
/**
* Registers Nuke tag for deletion logs
*
* @param string[] &$tags
*/
public static function onRegisterTags( array &$tags ): bool {
$tags[] = 'Nuke';
return true;
}
}

View file

@ -628,7 +628,7 @@ class SpecialNuke extends SpecialPage {
'userId' => $user->getId(),
'wikiPageId' => $title->getId(),
'suppress' => false,
'tags' => '[]',
'tags' => '["Nuke"]',
'logsubtype' => 'delete',
] );
$jobs[] = $job;

View file

@ -670,11 +670,12 @@ class SpecialNukeTest extends SpecialPageTestBase {
$this->assertStringContainsString( '(nuke-deletion-queued: Page123)', $html );
$this->assertStringContainsString( '(nuke-deletion-queued: Paging456)', $html );
$this->assertStringNotContainsString( 'Nuke', $this->getDeleteLogHtml() );
// Ensure all jobs are run
$this->runJobs();
$this->assertStringContainsString( 'Vandalism', $this->getDeleteLogHtml() );
$this->assertStringContainsString( 'Nuke', $this->getDeleteLogHtml() );
$this->assertStringContainsString( $fauxReason, $this->getDeleteLogHtml() );
}