diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-11-17 00:41:56 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-11-17 00:41:56 +0300 |
commit | fa75233a5eeaf961f58055da073e206c95f020f2 (patch) | |
tree | 5b4477d67f4cdef6cd3470f9c1c71ba60a931236 /plugins | |
parent | 74436365533366123a78bf646b245116b8c0c565 (diff) |
refs #4485 better error message in case a not yet installed plugin is required
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CorePluginsAdmin/PluginInstaller.php | 10 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/lang/en.json | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/plugins/CorePluginsAdmin/PluginInstaller.php b/plugins/CorePluginsAdmin/PluginInstaller.php index 8bb9c475d0..84b254e86e 100644 --- a/plugins/CorePluginsAdmin/PluginInstaller.php +++ b/plugins/CorePluginsAdmin/PluginInstaller.php @@ -165,8 +165,14 @@ class PluginInstaller if (!empty($missingDependencies)) { $message = ''; foreach ($missingDependencies as $dep) { - $params = array(ucfirst($dep['requirement']), $dep['actualVersion'], $dep['requiredVersion']); - $message .= Piwik::translate('CorePluginsAdmin_MissingRequirementsNotice', $params); + if (empty($dep['actualVersion'])) { + $params = array(ucfirst($dep['requirement']), $dep['requiredVersion'], $metadata->name); + $message .= Piwik::translate('CorePluginsAdmin_MissingRequirementsPleaseInstallNotice', $params); + } else { + $params = array(ucfirst($dep['requirement']), $dep['actualVersion'], $dep['requiredVersion']); + $message .= Piwik::translate('CorePluginsAdmin_MissingRequirementsNotice', $params); + } + } throw new PluginInstallerException($message); diff --git a/plugins/CorePluginsAdmin/lang/en.json b/plugins/CorePluginsAdmin/lang/en.json index a6e8fcbef8..dc13e89f8d 100644 --- a/plugins/CorePluginsAdmin/lang/en.json +++ b/plugins/CorePluginsAdmin/lang/en.json @@ -47,6 +47,7 @@ "MarketplaceSellPluginSubject": "Marketplace - Sell Plugin", "MenuPlatform": "Platform", "MissingRequirementsNotice": "Please update %1$s %2$s to a newer version, %1$s %3$s is required.", + "MissingRequirementsPleaseInstallNotice": "Please install %1$s %2$s as it is required by %3$s.", "NoPluginsFound": "No plugins found", "NotAllowedToBrowseMarketplacePlugins": "You can browse the list of plugins that can be installed to customize or extend your Piwik platform. Please contact your administrator if you need any of these installed.", "NotAllowedToBrowseMarketplaceThemes": "You can browse the list of themes that can be installed to customize the appearance of the Piwik platform. Please contact your administrator to get any of these installed for you.", |