From: James D. Forrester Date: Wed, 10 Oct 2018 23:17:28 +0000 (-0700) Subject: Drop UnknownAction, deprecated in 1.19(!) X-Git-Tag: 1.34.0-rc.0~3808^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=162af29e779a63249b5819e8655e286e3c2a2316;p=lhc%2Fweb%2Fwiklou.git Drop UnknownAction, deprecated in 1.19(!) Change-Id: Ia75552e69c07f6dc5da2f1e04ea813c912b04aef --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 6a005a065b..bff52e5442 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -345,6 +345,7 @@ because of Phabricator reports. * The hook 'UserGetImplicitGroups', deprecated since 1.25, has been removed. * The global function wfRunHooks, deprecated since 1.25, has now been removed. Use Hooks::run(). +* The hook 'UnknownAction', deprecated since 1.19, has now been removed. === Deprecations in 1.32 === * HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit diff --git a/docs/hooks.txt b/docs/hooks.txt index 9757a7ed9c..0641e88860 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -3560,12 +3560,6 @@ Since 1.24: Paths pointing to a directory will be recursively scanned for test case files matching the suffix "Test.php". &$paths: list of test cases and directories to search. -'UnknownAction': DEPRECATED since 1.19! To add an action in an extension, -create a subclass of Action, and add a new key to $wgActions. -An unknown "action" has occurred (useful for defining your own actions). -$action: action name -$article: article "acted on" - 'UnwatchArticle': Before a watch is removed from an article. &$user: user watching &$page: WikiPage object to be removed diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 4636ba349e..bc576374d6 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -501,18 +501,10 @@ class MediaWiki { $action->show(); return; } - // NOTE: deprecated hook. Add to $wgActions instead - if ( Hooks::run( - 'UnknownAction', - [ - $request->getVal( 'action', 'view' ), - $page - ], - '1.19' - ) ) { - $output->setStatusCode( 404 ); - $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' ); - } + + // If we've not found out which action it is by now, it's unknown + $output->setStatusCode( 404 ); + $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' ); } /** diff --git a/includes/actions/Action.php b/includes/actions/Action.php index fb761a7565..e5233f0607 100644 --- a/includes/actions/Action.php +++ b/includes/actions/Action.php @@ -30,7 +30,7 @@ use MediaWiki\MediaWikiServices; * are distinct from Special Pages because an action must apply to exactly one page. * * To add an action in an extension, create a subclass of Action, and add the key to - * $wgActions. There is also the deprecated UnknownAction hook + * $wgActions. * * Actions generally fall into two groups: the show-a-form-then-do-something-with-the-input * format (protect, delete, move, etc), and the just-do-something format (watch, rollback,