jbbarth / redmine_base_deface

Integrate with the deface gem to manage view modifications in plugins
MIT License
40 stars 34 forks source link

Update applicator_patch.rb and compatibility with redmine 5.0.2 #13

Closed qlefevre closed 2 years ago

qlefevre commented 2 years ago

I suggest to change module Deface to module ApplicatorPatch

Under Redmine 5.0.2 it doesn't work with the Zeitwerk loader:

/usr/local/bundle/gems/zeitwerk-2.6.0/lib/zeitwerk/loader/callbacks.rb:25:in `on_file_autoloaded': expected file /usr/src/redmine/plugins/redmine_base_deface/lib/applicator_patch.rb to define constant ApplicatorPatch, but didn't (Zeitwerk::NameError)

  raise Zeitwerk::NameError.new("expected file #{file} to define constant #{cpath}, but didn't", cref.last)

  ^^^^^

from /usr/local/bundle/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:28:in `require'
nanego commented 2 years ago

Hello. I wasn't able to reproduce the error. However, the issue comes from the filename, which does not match the module name. Does it resolve the problem if you just add an empty module at the end of the file? module ApplicatorPatch;end

nanego commented 2 years ago

The latest version of the plugin now address this issue. Thank you for bringing it to my attention.