Actions
Defect #38021
closedDevelopment mode, class-reloader is not work.
Defect #38021:
Development mode, class-reloader is not work.
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Resolution:
Duplicate
Affected version:
Description
http://127.0.0.1:3000/admin/info
Environment: Redmine version 5.0.4.stable Ruby version 2.6.9-p207 (2021-11-24) [x64-mingw32] Rails version 6.1.7 Environment development Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp Redmine settings: Redmine theme Default SCM: Subversion 1.14.1 Git 2.34.1 Filesystem Redmine plugins: demo 0.0.1
make a plugin:
plugin/config/routes.rb
plugins/demo/app/controllers/test_controller.rb
plugins/demo/app/views/test/index.html.erb
If I change value of @var, I have to reboot the server to make it effective.
I read the rails guide ( https://guides.rubyonrails.org/autoloading_and_reloading_constants.html ), made a simple try.
Append this line to REDMINE_ROOT/config/application.rb
Class Reloader work again!
Maybe, PluginLoader::add_autoload_paths need upgrade, it seems that it does not work properly in Zeitwerk mode.
REDMINE_ROOT/lib/redmine/plugin_loader.rb:130
def self.add_autoload_paths
directories.each do |directory|
# Add the plugin directories to rails autoload paths
engine_cfg = Rails::Engine::Configuration.new(directory.to_s)
engine_cfg.paths.add 'lib', eager_load: true
engine_cfg.eager_load_paths.each do |dir|
Rails.autoloaders.main.push_dir dir # <== Here??
end
end
end
Updated by Dmitry Makurin almost 4 years ago
Updated by Go MAEDA almost 4 years ago
- Is duplicate of Defect #36273: Modifying the source code of a plugin does not reload it after r21295 added
Updated by Go MAEDA almost 4 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
Fixed by #36273 for Redmine 5.0.5.
Actions