Defect #12590
closedPlugin routes.rb files are not getting included on Windows
0%
Description
Don't know if this is a new defect, the only defect I found similar has been #11609.
Routes.rb of plugins do not get processed, as a loop in routes.rb of Redmine does not read include them.
In short: Ruby 1.9.3, RubyGems 1.8.24, Rails 3.2.8, development and production, Windows 2012 Standard Server
See rake about and gem list attached for more Information.
I narrowed the issue down to a problem with the routes.rb file of Redmine.
On the bottom of the file there is some logic that does a Dir.glob(File.join(...)) and processes the directories within a loop.
Unfortunately only one iteration is done in this loop, thus only <REDMINE_ROOT>\plugins\.\routes.rb is being examined by File.exists.
I rewrote the loop now all plugins are loading correctly, and the controllers are getting mapped.
plugin_root = File.join(Rails.root, "plugins") Dir.foreach(File.join(plugin_root) do |plugin_dir| next if plugin_dir == '.' or plugin_dir == '..' file = File.join(plugin_root, plugin_dir, "config/routes.rb") if File.exists?(file) begin Rails.logger.info 'Loading plugin routes from ' + file instance_eval File.read(file) rescue Exception => e puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}." exit 1 end end end
Files
Related issues