Project

General

Profile

Actions

Defect #39803

open

Plugin modules no longer working

Added by Guus Teley 5 months ago. Updated 5 months ago.

Status:
Needs feedback
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

As of Redmine 5.1.x (Rails 7.1.2) plugins that rely on modules in the plugin/lib directory are no longer working.
Debugging lib/redmine/plugin_loader.rb shows that in add_autoload_paths in engine_cfg.all_eager_load_paths.each do |dir| the following directories are added:
  • app/controllers
  • app/helpers
  • app/models
  • lib

Note that the lib directory also has been added before with an explicit engine_cfg.paths.add 'lib', eager_load: true

Trying to force load the required module with require File.expand_path('../lib/my_module', __FILE__) or require_relative 'lib/my_module' doesn't help.
Before migrating to Rails 7, a simple require MyModule worked fine.


Files

init.rb (2.71 KB) init.rb Guus Teley, 2023-12-12 15:15
itgn_module.rb (1.21 KB) itgn_module.rb Guus Teley, 2023-12-12 15:15
39803.patch (3.31 KB) 39803.patch Marius BĂLTEANU, 2023-12-17 04:46

Related issues

Related to Redmine - Feature #36320: Migrate to Rails 7.1ReopenedMarius BĂLTEANU

Actions
Actions

Also available in: Atom PDF