New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activating a plugin should fail when the plugin has missing dependencies #10401
Conversation
For example via plugin:activate console command. without this patch it looks like the plugin:activate worked but it didn't
* @param $plugin Plugin | ||
* @throws \Exception | ||
*/ | ||
private function throwIfPluginMissingDependencies($plugin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you maybe move this method in another class and make it public so it can be tested? the string formatting part might be also useful for plugins/CorePluginsAdmin/templates/macros.twig and https://github.com/piwik/piwik/blob/2.16.2/core/Plugin/Manager.php#L831 where it should be actually deactivated the plugin even before we try to install I think
|
||
$causedBy = array(); | ||
foreach ($missingDependencies as $dependency) { | ||
$causedBy[] = strtoupper($dependency['requirement']) . ' ' . $dependency['causedBy']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be rather capitalize instead of strtoupper. There will be also plugin names etc. For PHP we have in the Marketplace a special if to convert it to upper case
Conflicts: libs/bower_components/jquery.scrollTo/README.md libs/bower_components/jquery.scrollTo/jquery.scrollTo.min.js libs/bower_components/jquery.scrollTo/scrollTo.jquery.json plugins/CorePluginsAdmin/lang/en.json plugins/CorePluginsAdmin/templates/macros.twig
Will re-create the PR clean, as I included submodules by mistake |
Bug: when using
plugin:activate
console command: without this patch it looks like the plugin:activate worked but it didn't