From 731a9bf40456d697db45c59a88f0fa0da9ee7a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Tue, 7 Jun 2022 14:16:48 +0200 Subject: [PATCH] Error while loading /settings #1364 --- lib/redmine_dmsf/patches/notifiable_patch.rb | 2 +- lib/redmine_dmsf/patches/notifiable_ru_patch.rb | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/redmine_dmsf/patches/notifiable_patch.rb b/lib/redmine_dmsf/patches/notifiable_patch.rb index fe16237e..f1d803d5 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 !Redmine::Plugin.installed?(:redmine_contacts) +elsif !(Redmine::Plugin.installed?(:redmine_contacts) || Redmine::Plugin.installed?(:redmine_questions)) Redmine::Notifiable.prepend RedmineDmsf::Patches::NotifiablePatch end \ No newline at end of file diff --git a/lib/redmine_dmsf/patches/notifiable_ru_patch.rb b/lib/redmine_dmsf/patches/notifiable_ru_patch.rb index 7c5abd40..5c53ba01 100644 --- a/lib/redmine_dmsf/patches/notifiable_ru_patch.rb +++ b/lib/redmine_dmsf/patches/notifiable_ru_patch.rb @@ -22,8 +22,8 @@ module RedmineDmsf module Patches - # TODO: This is just a workaround to fix alias_method usage in redmine_resources plugin, which is in conflict with - # prepend and causes an infinite loop with RedmineUp's Resource plugin . + # TODO: This is just a workaround to fix alias_method usage in RedmineUp's plugins, which is in conflict with + # prepend and causes an infinite loop. module NotifiableRuPatch def self.included(base) @@ -54,6 +54,7 @@ module RedmineDmsf end # Apply the patch -if Redmine::Plugin.installed?(:redmine_contacts) && !Redmine::Plugin.installed?(:easy_extensions) +if (Redmine::Plugin.installed?(:redmine_contacts) || Redmine::Plugin.installed?(:redmine_questions)) && + !Redmine::Plugin.installed?(:easy_extensions) Redmine::Notifiable.send :include, RedmineDmsf::Patches::NotifiableRuPatch end \ No newline at end of file