From 3174ddfef162c2cd507c88a6d022975ecb3fbefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Fri, 27 Jan 2023 10:52:35 +0100 Subject: [PATCH] Internal error while opening Settings page #1424 --- lib/redmine_dmsf/patches/notifiable_patch.rb | 2 +- lib/redmine_dmsf/patches/notifiable_ru_patch.rb | 3 +-- lib/redmine_dmsf/plugin.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/redmine_dmsf/patches/notifiable_patch.rb b/lib/redmine_dmsf/patches/notifiable_patch.rb index d2cdce2b..766522c2 100644 --- a/lib/redmine_dmsf/patches/notifiable_patch.rb +++ b/lib/redmine_dmsf/patches/notifiable_patch.rb @@ -55,6 +55,6 @@ end if Redmine::Plugin.installed?(:easy_extensions) RedmineExtensions::PatchManager.register_patch_to_be_first 'Redmine::Notifiable', 'RedmineDmsf::Patches::NotifiablePatch', prepend: true, first: true -elsif(!RedmineDmsf::Plugin.an_osolete_plugin_present?) +elsif !RedmineDmsf::Plugin.an_osolete_plugin_present? Redmine::Notifiable.prepend RedmineDmsf::Patches::NotifiablePatch end diff --git a/lib/redmine_dmsf/patches/notifiable_ru_patch.rb b/lib/redmine_dmsf/patches/notifiable_ru_patch.rb index 4a74ddb6..fb4bdb43 100644 --- a/lib/redmine_dmsf/patches/notifiable_ru_patch.rb +++ b/lib/redmine_dmsf/patches/notifiable_ru_patch.rb @@ -54,7 +54,6 @@ module RedmineDmsf end # Apply the patch -if (RedmineDmsf::Plugin.present?(:redmine_questions) || Redmine::Plugin.installed?(:redmine_contacts) || - Redmine::Plugin.installed?(:redmine_checklists)) && !Redmine::Plugin.installed?(:easy_extensions) +if RedmineDmsf::Plugin.an_osolete_plugin_present? && !Redmine::Plugin.installed?(:easy_extensions) Redmine::Notifiable.send :include, RedmineDmsf::Patches::NotifiableRuPatch end diff --git a/lib/redmine_dmsf/plugin.rb b/lib/redmine_dmsf/plugin.rb index cb6b6966..1425e856 100644 --- a/lib/redmine_dmsf/plugin.rb +++ b/lib/redmine_dmsf/plugin.rb @@ -33,7 +33,7 @@ module RedmineDmsf # present. # It is related especially to plugins made by AplhaNode and RedmineUP. def self.an_osolete_plugin_present? - plugins = %w(questions contacts checklists db passwords) + plugins = %w(questions contacts checklists db passwords resources) plugins.each do|plugin| if Plugin.present?("redmine_#{plugin}") return true