Update hooks to use PageSaveComplete

Extension requires MW 1.35+, always available

Bug: T250566
Change-Id: I35a288d38e944df4498d63f1d686ee7904909c74
This commit is contained in:
DannyS712 2020-06-16 04:30:26 +00:00
parent ac0c5edabe
commit e5a7ed6997
2 changed files with 16 additions and 8 deletions

View file

@ -104,7 +104,7 @@
"EditFilter": [
"TitleBlacklistHooks::onValidateBlacklist"
],
"PageContentSaveComplete": [
"PageSaveComplete": [
"TitleBlacklistHooks::onClearBlacklist"
],
"ScribuntoExternalLibraries": [

View file

@ -6,6 +6,10 @@
* @license GPL-2.0-or-later
*/
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Storage\EditResult;
use MediaWiki\User\UserIdentity;
/**
* Hooks for the TitleBlacklist class
*
@ -207,18 +211,22 @@ class TitleBlacklistHooks {
}
/**
* PageContentSaveComplete hook
* PageSaveComplete hook
*
* @param WikiPage $wikiPage
* @param User $user
* @param Content $content
* @param UserIdentity $userIdentity
* @param string $summary
* @param bool $isminor
* @param bool $iswatch
* @param string $section
* @param int $flags
* @param RevisionRecord $revisionRecord
* @param EditResult $editResult
*/
public static function onClearBlacklist(
WikiPage $wikiPage, $user, $content, $summary, $isminor, $iswatch, $section
WikiPage $wikiPage,
UserIdentity $userIdentity,
string $summary,
int $flags,
RevisionRecord $revisionRecord,
EditResult $editResult
) {
$title = $wikiPage->getTitle();
if ( $title->getNamespace() === NS_MEDIAWIKI && $title->getDBkey() == 'Titleblacklist' ) {