jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/330138 )
Change subject: Fully deprecate 'ContentAction' hook ...................................................................... Fully deprecate 'ContentAction' hook Bug: T54027 Change-Id: Ia765e25a9f76b34f7b10125d3b6e0c8e00fac2ca --- M RELEASE-NOTES-1.29 M docs/hooks.txt M includes/MediaWiki.php 3 files changed, 14 insertions(+), 4 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29 index 14b5692..f2d738a 100644 --- a/RELEASE-NOTES-1.29 +++ b/RELEASE-NOTES-1.29 @@ -152,6 +152,8 @@ * Class ImageGallery (deprecated in 1.22) was removed. Use ImageGalleryBase::factory instead. * Title::moveNoAuth() (deprecated in 1.25) was removed. Use MovePage class instead. +* Hook UnknownAction (deprecated in 1.19) was actually deprecated (it will now emit warnings). + Create a subclass of Action, and add it to $wgActions instead. == Compatibility == diff --git a/docs/hooks.txt b/docs/hooks.txt index e8335cd..2f99fff 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -3420,8 +3420,9 @@ test case files matching the suffix "Test.php". &$paths: list of test cases and directories to search. -'UnknownAction': An unknown "action" has occurred (useful for defining your own -actions). +'UnknownAction': DEPRECATED! 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" diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index eaa1c995..faca533 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -495,8 +495,15 @@ $action->show(); return; } - - if ( Hooks::run( 'UnknownAction', [ $request->getVal( 'action', 'view' ), $page ] ) ) { + // 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' ); } -- To view, visit https://gerrit.wikimedia.org/r/330138 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia765e25a9f76b34f7b10125d3b6e0c8e00fac2ca Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Filip <r...@protonmail.com> Gerrit-Reviewer: Reedy <re...@wikimedia.org> Gerrit-Reviewer: TTO <at.li...@live.com.au> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits