From 09cfb1269a9ba2bfdbb775b8ba717d9e64e2f21c Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Mon, 12 Feb 2018 22:06:05 +0100 Subject: [PATCH] resourceloader: Remove ResourceLoaderModule::getPosition @deprecated since 1.29 Bug: T184257 Change-Id: I1a59a1f0a5fbedfea9f0b28bee8c298710557a8d --- RELEASE-NOTES-1.31 | 1 + includes/OutputPage.php | 19 +++++++++---------- .../resourceloader/ResourceLoaderModule.php | 10 ---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index cc08b33e84..449751666e 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -233,6 +233,7 @@ changes to languages because of Phabricator reports. * CommentStore::getCommentLegacy * CommentStore::insert * CommentStore::insertWithTemplate +* The method ResourceLoaderModule::getPosition(), deprecated in 1.29, has been removed. == Compatibility == MediaWiki 1.31 requires PHP 5.5.9 or later. Although HHVM 3.18.5 or later is supported, diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 6b44a557b4..01b450b457 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -493,7 +493,7 @@ class OutputPage extends ContextSource { * Filter an array of modules to remove insufficiently trustworthy members, and modules * which are no longer registered (eg a page is cached before an extension is disabled) * @param array $modules - * @param string|null $position If not null, only return modules with this position + * @param string|null $position Unused * @param string $type * @return array */ @@ -506,7 +506,6 @@ class OutputPage extends ContextSource { $module = $resourceLoader->getModule( $val ); if ( $module instanceof ResourceLoaderModule && $module->getOrigin() <= $this->getAllowedModules( $type ) - && ( is_null( $position ) || $module->getPosition() == $position ) ) { if ( $this->mTarget && !in_array( $this->mTarget, $module->getTargets() ) ) { $this->warnModuleTargetFilter( $module->getName() ); @@ -537,7 +536,7 @@ class OutputPage extends ContextSource { * Get the list of modules to include on this page * * @param bool $filter Whether to filter out insufficiently trustworthy modules - * @param string|null $position If not null, only return modules with this position + * @param string|null $position Unused * @param string $param * @param string $type * @return array Array of module names @@ -547,7 +546,7 @@ class OutputPage extends ContextSource { ) { $modules = array_values( array_unique( $this->$param ) ); return $filter - ? $this->filterModules( $modules, $position, $type ) + ? $this->filterModules( $modules, null, $type ) : $modules; } @@ -566,11 +565,11 @@ class OutputPage extends ContextSource { * Get the list of module JS to include on this page * * @param bool $filter - * @param string|null $position + * @param string|null $position Unused * @return array Array of module names */ public function getModuleScripts( $filter = false, $position = null ) { - return $this->getModules( $filter, $position, 'mModuleScripts', + return $this->getModules( $filter, null, 'mModuleScripts', ResourceLoaderModule::TYPE_SCRIPTS ); } @@ -590,11 +589,11 @@ class OutputPage extends ContextSource { * Get the list of module CSS to include on this page * * @param bool $filter - * @param string|null $position + * @param string|null $position Unused * @return array Array of module names */ public function getModuleStyles( $filter = false, $position = null ) { - return $this->getModules( $filter, $position, 'mModuleStyles', + return $this->getModules( $filter, null, 'mModuleStyles', ResourceLoaderModule::TYPE_STYLES ); } @@ -2977,8 +2976,8 @@ class OutputPage extends ContextSource { } /** - * JS stuff to put at the bottom of the ``. These are modules with position 'bottom', - * legacy scripts ($this->mScripts), and user JS. + * JS stuff to put at the bottom of the ``. + * These are legacy scripts ($this->mScripts), and user JS. * * @return string|WrappedStringList HTML */ diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index def0eed716..3be687b785 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -327,16 +327,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface { return 'local'; } - /** - * From where in the page HTML should this module be loaded? - * - * @deprecated since 1.29 Obsolete. All modules load async from ``. - * @return string - */ - public function getPosition() { - return 'top'; - } - /** * Whether this module's JS expects to work without the client-side ResourceLoader module. * Returning true from this function will prevent mw.loader.state() call from being -- 2.20.1