From 8a7b7c3f119da219e0d56fce7680374323d77734 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 30 Aug 2017 21:07:49 +0200 Subject: [PATCH] Remove deprecated hook EditPageBeforeEditChecks Change-Id: I525a3a81787214dae42d3ce641d8c62761d17797 --- RELEASE-NOTES-1.32 | 2 ++ docs/hooks.txt | 8 -------- includes/EditPage.php | 22 ---------------------- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 8649e5e101..b1f93f9c80 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -158,6 +158,8 @@ because of Phabricator reports. minor change to implement the toggle feature with CSS instead. To restore prior functionality, either explicitly load "jquery.mw-jump" in your skin or refer to T195256 for details on how to make the same change. +* Hook 'EditPageBeforeEditChecks' was removed; + use 'EditPageGetCheckboxesDefinition' instead. === Deprecations in 1.32 === * Use of a StartProfiler.php file is deprecated in favour of placing diff --git a/docs/hooks.txt b/docs/hooks.txt index 8c84509b56..520133d8a5 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1461,14 +1461,6 @@ textarea in the edit form. &$buttons: Array of edit buttons "Save", "Preview", "Live", and "Diff" &$tabindex: HTML tabindex of the last edit check/button -'EditPageBeforeEditChecks': DEPRECATED! Use 'EditPageGetCheckboxesDefinition' instead, -or 'EditPage::showStandardInputs:options' if you don't actually care about checkboxes -and just want to add some HTML to the page. -Allows modifying the edit checks below the textarea in the edit form. -&$editpage: The current EditPage object -&$checks: Array of the HTML for edit checks like "watch this page"/"minor edit" -&$tabindex: HTML tabindex of the last edit check/button - 'EditPageBeforeEditToolbar': Allows modifying the edit toolbar above the textarea in the edit form. &$toolbar: The toolbar HTML diff --git a/includes/EditPage.php b/includes/EditPage.php index 22c29d6413..a484e40d73 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -4226,28 +4226,6 @@ ERROR; ); } - // Backwards-compatibility hack to run the EditPageBeforeEditChecks hook. It's important, - // people have used it for the weirdest things completely unrelated to checkboxes... - // And if we're gonna run it, might as well allow its legacy checkboxes to be shown. - $legacyCheckboxes = []; - if ( !$this->isNew ) { - $legacyCheckboxes['minor'] = ''; - } - $legacyCheckboxes['watch'] = ''; - // Copy new-style checkboxes into an old-style structure - foreach ( $checkboxes as $name => $oouiLayout ) { - $legacyCheckboxes[$name] = (string)$oouiLayout; - } - // Avoid PHP 7.1 warning of passing $this by reference - $ep = $this; - Hooks::run( 'EditPageBeforeEditChecks', [ &$ep, &$legacyCheckboxes, &$tabindex ], '1.29' ); - // Copy back any additional old-style checkboxes into the new-style structure - foreach ( $legacyCheckboxes as $name => $html ) { - if ( $html && !isset( $checkboxes[$name] ) ) { - $checkboxes[$name] = new OOUI\Widget( [ 'content' => new OOUI\HtmlSnippet( $html ) ] ); - } - } - return $checkboxes; } -- 2.20.1