mikitex70 / redmine_drawio

Macro plugin to embed draw.io diagrams into Redmine wiki pages
MIT License
121 stars 51 forks source link

v1.4.3 and develop do not work with redmine 4.2.x #121

Closed hsssystems closed 1 year ago

hsssystems commented 1 year ago

Hi,

we get this error with v1.4.3 and develop:

redmine_1    | W, [2022-09-13T03:54:37.348631 #129]  WARN -- : Creating scope :sorted. Overwriting existing method Group.sorted.
redmine_1    | W, [2022-09-13T03:54:37.358035 #129]  WARN -- : Creating scope :sorted. Overwriting existing method User.sorted.
redmine_1    | W, [2022-09-13T03:54:37.888803 #129]  WARN -- : Creating scope :visible. Overwriting existing method Principal.visible.
redmine_1    | W, [2022-09-13T03:54:38.306017 #129]  WARN -- : Creating scope :visible. Overwriting existing method AgileQuery.visible.
redmine_1    | W, [2022-09-13T03:54:38.316730 #129]  WARN -- : Creating scope :visible. Overwriting existing method AgileVersionsQuery.visible.
redmine_1    | /usr/src/redmine/plugins/redmine_drawio/lib/redmine_drawio/helpers/common_mark_helper.rb:50:in `<top (required)>': uninitialized constant Redmine::WikiFormatting::CommonMark (NameError)
redmine_1    |  from /usr/local/bundle/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
redmine_1    |  from /usr/local/bundle/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
redmine_1    |  from /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
redmine_1    |  from /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
redmine_1    |  from /usr/local/bundle/gems/activesupport-5.2.6/lib/active_support/dependencies/interlock.rb:13:in `loading'
redmine_1    |  from /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
redmine_1    |  from /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:477:in `each'
redmine_1    |  from /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:477:in `block in eager_load!'
redmine_1    |  from /usr/local/bundle/gems/railties-5.2.6/lib/rails/engine.rb:475:in `each'
redmine_1    |  from /usr/local/bundle/gems/railties-5

Workaround was this:

diff --git a/lib/redmine_drawio/helpers/common_mark_helper.rb b/lib/redmine_drawio/h
index 6c45c06..3ec3a1f 100644
--- a/lib/redmine_drawio/helpers/common_mark_helper.rb
+++ b/lib/redmine_drawio/helpers/common_mark_helper.rbdiff --git a/lib/redmine_drawio/helpers/common_mark_helper.rb b/lib/redmine_drawio/h
index 6c45c06..3ec3a1f 100644
--- a/lib/redmine_drawio/helpers/common_mark_helper.rb
+++ b/lib/redmine_drawio/helpers/common_mark_helper.rb
@@ -22,7 +22,7 @@ if Rails::VERSION::STRING >= '5.0.0'
         end
     end

-    module Redmine::WikiFormatting::CommonMark::Helper
-        prepend RedmineDrawio::Helpers::CommonMarkHelper
-    end
+    #module Redmine::WikiFormatting::CommonMark::Helper
+    #    prepend RedmineDrawio::Helpers::CommonMarkHelper
+    #end
 end
@@ -22,7 +22,7 @@ if Rails::VERSION::STRING >= '5.0.0'
         end
     end

-    module Redmine::WikiFormatting::CommonMark::Helper
-        prepend RedmineDrawio::Helpers::CommonMarkHelper
-    end
+    #module Redmine::WikiFormatting::CommonMark::Helper
+    #    prepend RedmineDrawio::Helpers::CommonMarkHelper
+    #end
 end

Maybe the 3 lines are only for redmine 5?

mikitex70 commented 1 year ago

Sorry, my stupid mistake, I confused the Redmine version with the Rails version. The issue is now fixed in version v1.4.4. Thank you for reporting it.