Added by Jérôme BATAILLE over 7 years ago. Updated over 7 years ago.
Description
The exception is :
lib/redmine/plugin.rb:141:in `find': Redmine::PluginNotFound (Redmine::PluginNotFound)
It would be better if it is :
lib/redmine/plugin.rb:273:in `rescue in requires_redmine_plugin': redmine_smile_enhancements plugin requires plugin redmine_smile_base (Redmine::PluginNotFound)
Files
Here is the patch.
I think it should catch only PluginNotFound exception.
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index ec575d17a..16e266da1 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -270,7 +270,11 @@ module Redmine arg = { :version_or_higher => arg } unless arg.is_a?(Hash) arg.assert_valid_keys(:version, :version_or_higher) - plugin = Plugin.find(plugin_name) + begin + plugin = Plugin.find(plugin_name) + rescue PluginNotFound + raise PluginRequirementError.new("#{id} plugin requires the #{plugin_name} plugin") + end current = plugin.version.split('.').collect(&:to_i) arg.each do |k, v|
Setting the target version to 4.0.3.
Committed, thanks.
Thanks to have merged this patch.
Also available in: PDF Atom