Redmine plugin needs to patch ApplicationController first? -


this in redmine 1.3.

i patching applicationcontroller add behavior (really, include helper) in controllers. problem controllers patched before applicationcontroller patch don't new behavior.

this works fine:

dispatcher.to_prepare :my_plugin   require_dependency 'my_plugin/application_controller_patch'   require_dependency 'my_plugin/welcome_controller_patch' end 

but this, welcomecontroller throws error when call helper added.

dispatcher.to_prepare :my_plugin   require_dependency 'my_plugin/welcome_controller_patch'   require_dependency 'my_plugin/application_controller_patch' end 

this easy fix within plugin, problem i'm having plugin patching controller , it's subsequently losing fix. worse, happens in production -- in development, think plugin order different because works fine. don't see way alter plugin order.

i'm pretty sure patch fine, in case looks this:

require_dependency 'application_controller'    module myplugin::applicationcontrollerpatch    def self.included(base) # :nodoc:     base.extend(classmethods)     base.send(:include, instancemethods)     base.class_eval       unloadable       helper :search       include searchhelper     end   end    module classmethods       end    module instancemethods   end # of instancemethods end # of module  applicationcontroller.send(:include, myplugin::applicationcontrollerpatch) 

of course, figure out once i've gone , asked question.

in config/additional_environment.rb, line

config.plugins = [ :my_plugin, :all ] 

ensures plugin loaded first. seems have fixed behavior.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -