From b3150af153f7a8ff4746e61a56b83fe074c2bca9 Mon Sep 17 00:00:00 2001 From: Jack Wilkinson Date: Fri, 23 Apr 2021 21:05:11 +0100 Subject: [PATCH 1/5] Added method to expose replacement map --- modules/system/classes/PluginManager.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index a15b6f91fe..ced3d9b9ca 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -668,6 +668,16 @@ protected function populateDisabledPluginsFromDb() } } + /** + * Returns the plugin replacements defined in $this->replacementMap + * + * @return array + */ + public function getReplacementMap() + { + return $this->replacementMap; + } + /** * Evaluates and initializes the plugin replacements defined in $this->replacementMap * From 9a35cb24386f5ab48ea996275de259af8e0ca6c7 Mon Sep 17 00:00:00 2001 From: Jack Wilkinson Date: Fri, 23 Apr 2021 21:05:42 +0100 Subject: [PATCH 2/5] Added replacement waring lang entries --- modules/system/lang/en/lang.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index 04543a769e..cf922903cd 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -336,6 +336,8 @@ 'core_set_build' => 'Setting build number', 'update_warnings_title' => 'Some issues have been detected and require attention:', 'update_warnings_plugin_missing' => 'The :parent_code plugin requires :code to be installed before it will work', + 'update_warnings_plugin_replace' => 'The :plugin plugin replaces :alias, please remove :alias to ensure the are no conflicts', + 'update_warnings_plugin_replace_cli' => 'This plugin replaces :alias, please remove :alias to ensure the are no conflicts', 'changelog' => 'Changelog', 'changelog_view_details' => 'View details', 'plugins' => 'Plugins', From ce643c584c40528be399243e658b93feb5d3072b Mon Sep 17 00:00:00 2001 From: Jack Wilkinson Date: Fri, 23 Apr 2021 21:06:31 +0100 Subject: [PATCH 3/5] Added replace warning to update manager for cli --- modules/system/classes/UpdateManager.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index c27748e045..db9d238709 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -184,6 +184,13 @@ public function update() } } + // Set replacement warning messages + foreach ($this->pluginManager->getReplacementMap() as $alias => $plugin) { + $this->addMessage($plugin, Lang::get('system::lang.updates.update_warnings_plugin_replace_cli', [ + 'alias' => '' . $alias . '' + ])); + } + // Print messages returned by migrations / seeders $this->printMessages(); From 959176d6bcf4ffd39719dea741e2f6aa83507d5c Mon Sep 17 00:00:00 2001 From: Jack Wilkinson Date: Fri, 23 Apr 2021 21:07:08 +0100 Subject: [PATCH 4/5] Added replace warning to updates controller for backend ui --- modules/system/controllers/Updates.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php index b6ad688365..765873dc2a 100644 --- a/modules/system/controllers/Updates.php +++ b/modules/system/controllers/Updates.php @@ -244,6 +244,15 @@ protected function getWarnings() } } + $replacementMap = PluginManager::instance()->getReplacementMap(); + + foreach ($replacementMap as $alias => $plugin) { + $warnings[] = Lang::get('system::lang.updates.update_warnings_plugin_replace', [ + 'plugin' => '' . $plugin . '', + 'alias' => '' . $alias . '' + ]); + } + return $warnings; } From 7b7b369686b28a0a777e0feeb3db469a4bc6e861 Mon Sep 17 00:00:00 2001 From: Jack Wilkinson Date: Fri, 23 Apr 2021 21:53:31 +0100 Subject: [PATCH 5/5] Fixed grammar --- modules/system/lang/en/lang.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index cf922903cd..e6e506e80f 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -336,8 +336,8 @@ 'core_set_build' => 'Setting build number', 'update_warnings_title' => 'Some issues have been detected and require attention:', 'update_warnings_plugin_missing' => 'The :parent_code plugin requires :code to be installed before it will work', - 'update_warnings_plugin_replace' => 'The :plugin plugin replaces :alias, please remove :alias to ensure the are no conflicts', - 'update_warnings_plugin_replace_cli' => 'This plugin replaces :alias, please remove :alias to ensure the are no conflicts', + 'update_warnings_plugin_replace' => 'The :plugin plugin replaces :alias, please remove :alias to ensure there are no conflicts', + 'update_warnings_plugin_replace_cli' => 'This plugin replaces :alias, please remove :alias to ensure there are no conflicts', 'changelog' => 'Changelog', 'changelog_view_details' => 'View details', 'plugins' => 'Plugins',