プロジェクト

全般

プロフィール

Vote #79912

完了

Include plugin name in the exception when the plugin required by requires_redmine_plugin is not found

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Plugin API_20
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
20
version_id:
148
issue_org_id:
31030
author_id:
36999
assigned_to_id:
1
comments:
6
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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)

journals

Here is the patch.
--------------------------------------------------------------------------------
I think it should catch only PluginNotFound exception.

<pre><code class="diff">
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|
</code></pre>
--------------------------------------------------------------------------------
Setting the target version to 4.0.3.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------
Thanks to have merged this patch.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリPlugin API_20 にセット
  • 対象バージョン4.0.3_148 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0