From c81540d7251b468f632791c7187a6f3709087712 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 25 Jun 2015 18:40:18 +0200 Subject: [PATCH] Remove deprecated $wgSpecialPageGroups $wgSpecialPageGroups is deprecated since 1.21 override SpecialPage::getGroupName instead Remove also SpecialPageFactory::setGroup because it no long can set $wgSpecialPageGroups. Also remove SpecialPageFactory::getGroup along with its setter. All replaces in extensions can be found under: https://gerrit.wikimedia.org/r/#/q/status:open+branch:master+topic:wgSpecialPageGroups,n,z https://gerrit.wikimedia.org/r/#/q/status:merged+branch:master+topic:wgSpecialPageGroups,n,z Change-Id: I1aa8f98bf326b2e54d7403efbb9f002a106cefc5 --- RELEASE-NOTES-1.26 | 3 ++ includes/DefaultSettings.php | 8 ------ includes/specialpage/SpecialPage.php | 17 +---------- includes/specialpage/SpecialPageFactory.php | 28 ------------------- .../convertExtensionToRegistration.php | 2 +- 5 files changed, 5 insertions(+), 53 deletions(-) diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26 index dc36d00b7f..518a233fe7 100644 --- a/RELEASE-NOTES-1.26 +++ b/RELEASE-NOTES-1.26 @@ -117,6 +117,9 @@ changes to languages because of Bugzilla reports. instead of many optional positional arguments. Calling the constructor the old way will issue a deprecation warning. * The jquery.mwExtension module was deprecated. +* $wgSpecialPageGroups was removed (deprecated in 1.21). +* SpecialPageFactory::setGroup was removed (deprecated in 1.21). +* SpecialPageFactory::getGroup was removed (deprecated in 1.21). == Compatibility == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c0fd345afe..6f2f5b9ba4 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -6969,14 +6969,6 @@ $wgAllowSpecialInclusion = true; */ $wgDisableQueryPageUpdate = false; -/** - * List of special pages, followed by what subtitle they should go under - * at Special:SpecialPages - * - * @deprecated since 1.21 Override SpecialPage::getGroupName instead - */ -$wgSpecialPageGroups = array(); - /** * On Special:Unusedimages, consider images "used", if they are put * into a category. Default (false) is not to count those as used. diff --git a/includes/specialpage/SpecialPage.php b/includes/specialpage/SpecialPage.php index a7a43b0e30..eb18b8f1af 100644 --- a/includes/specialpage/SpecialPage.php +++ b/includes/specialpage/SpecialPage.php @@ -662,7 +662,6 @@ class SpecialPage { */ public function getFinalGroupName() { $name = $this->getName(); - $specialPageGroups = $this->getConfig()->get( 'SpecialPageGroups' ); // Allow overbidding the group from the wiki side $msg = $this->msg( 'specialpages-specialpagegroup-' . strtolower( $name ) )->inContentLanguage(); @@ -671,18 +670,6 @@ class SpecialPage { } else { // Than use the group from this object $group = $this->getGroupName(); - - // Group '-' is used as default to have the chance to determine, - // if the special pages overrides this method, - // if not overridden, $wgSpecialPageGroups is checked for b/c - if ( $group === '-' && isset( $specialPageGroups[$name] ) ) { - $group = $specialPageGroups[$name]; - } - } - - // never give '-' back, change to 'other' - if ( $group === '-' ) { - $group = 'other'; } return $group; @@ -697,8 +684,6 @@ class SpecialPage { * @since 1.21 */ protected function getGroupName() { - // '-' used here to determine, if this group is overridden or has a hardcoded 'other' - // Needed for b/c in getFinalGroupName - return '-'; + return 'other'; } } diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php index 3786b36227..055e5887e8 100644 --- a/includes/specialpage/SpecialPageFactory.php +++ b/includes/specialpage/SpecialPageFactory.php @@ -347,34 +347,6 @@ class SpecialPageFactory { return array( $name, $par ); } - /** - * Add a page to a certain display group for Special:SpecialPages - * - * @param SpecialPage|string $page - * @param string $group - * @deprecated since 1.21 Override SpecialPage::getGroupName - */ - public static function setGroup( $page, $group ) { - wfDeprecated( __METHOD__, '1.21' ); - - global $wgSpecialPageGroups; - $name = is_object( $page ) ? $page->getName() : $page; - $wgSpecialPageGroups[$name] = $group; - } - - /** - * Get the group that the special page belongs in on Special:SpecialPage - * - * @param SpecialPage $page - * @return string - * @deprecated since 1.21 Use SpecialPage::getFinalGroupName - */ - public static function getGroup( &$page ) { - wfDeprecated( __METHOD__, '1.21' ); - - return $page->getFinalGroupName(); - } - /** * Check if a given name exist as a special page or as a special page alias * diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index b7fe80b36d..3e86d8a6d8 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -31,7 +31,7 @@ class ConvertExtensionToRegistration extends Maintenance { * @var array */ protected $noLongerSupportedGlobals = array( - 'SpecialPageGroups' => 'deprecated', + 'SpecialPageGroups' => 'deprecated', // Deprecated 1.21, removed in 1.26 ); /** -- 2.20.1