diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2017-05-13 01:37:40 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-05-13 01:37:40 +0300 |
commit | 1d6eba632ff0412d12d4de83f4f369377a17d6c2 (patch) | |
tree | 4c288235fea16e0c00fd561b375fd878023021e4 /core | |
parent | b0c772bc0040ce038e16f96955e538d0a1531ed4 (diff) |
Unload plugin instead of deactivating it when a plugin has a missing dependency (#11682)
Deactivating a plugin in case of a missing dependency is a bit risky. If just once a dependency is missing it would be directly deactivated. For example during an update we may run into an issue where a plugin dependency might be missing just for a short time frame. There may be also other edge cases where this might be the case. It would be better to instead trigger a notification only. I would show this notification only to super users but we do not have anything loaded at this time.
Any other ideas?
Diffstat (limited to 'core')
-rw-r--r-- | core/Plugin/Manager.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php index 60fd9aa9bb..9466304e27 100644 --- a/core/Plugin/Manager.php +++ b/core/Plugin/Manager.php @@ -868,17 +868,17 @@ class Manager } if ($newPlugin->hasMissingDependencies()) { - $this->deactivatePlugin($pluginName); + $this->unloadPluginFromMemory($pluginName); // at this state we do not know yet whether current user has super user access. We do not even know // if someone is actually logged in. - $message = Piwik::translate('CorePluginsAdmin_WeDeactivatedThePluginAsItHasMissingDependencies', array($pluginName, $newPlugin->getMissingDependenciesAsString())); + $message = Piwik::translate('CorePluginsAdmin_WeCouldNotLoadThePluginAsItHasMissingDependencies', array($pluginName, $newPlugin->getMissingDependenciesAsString())); $message .= ' '; $message .= Piwik::translate('General_PleaseContactYourPiwikAdministrator'); $notification = new Notification($message); $notification->context = Notification::CONTEXT_ERROR; - Notification\Manager::notify('PluginManager_PluginDeactivated', $notification); + Notification\Manager::notify('PluginManager_PluginUnloaded', $notification); return $pluginsToPostPendingEventsTo; } |