Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8083837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:36:10+00:00 2026-06-05T17:36:10+00:00

This is in Redmine 1.3. I am patching ApplicationController to add behavior (really, just

  • 0

This is in Redmine 1.3.

I am patching ApplicationController to add behavior (really, just to include a helper) in all controllers. The problem is that any controllers that are patched before my ApplicationController patch don’t get the new behavior.

This works fine:

Dispatcher.to_prepare :my_plugin do
  require_dependency 'my_plugin/application_controller_patch'
  require_dependency 'my_plugin/welcome_controller_patch'
end

But with this, the WelcomeController throws an error when I call the helper I added.

Dispatcher.to_prepare :my_plugin do
  require_dependency 'my_plugin/welcome_controller_patch'
  require_dependency 'my_plugin/application_controller_patch'
end

This is easy to fix within a plugin, but the problem I’m having is that another plugin is patching a controller and it’s subsequently losing my fix. Worse, this only happens in production — in development, I think the plugin order is different because it works fine. I don’t see a way to alter the plugin order.

I’m pretty sure my patch itself is fine, but just in case it looks like this:

require_dependency 'application_controller'  

module MyPlugin::ApplicationControllerPatch

  def self.included(base) # :nodoc:
    base.extend(ClassMethods)
    base.send(:include, InstanceMethods)
    base.class_eval do
      unloadable
      helper :search
      include SearchHelper
    end
  end

  module ClassMethods    
  end

  module InstanceMethods
  end # of InstanceMethods
end # of module

ApplicationController.send(:include, MyPlugin::ApplicationControllerPatch)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:36:12+00:00Added an answer on June 5, 2026 at 5:36 pm

    Of course, I figure it out once I’ve gone and asked the question.

    In config/additional_environment.rb, the line

    config.plugins = [ :my_plugin, :all ]
    

    ensures that my plugin is loaded first. This seems to have fixed the behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is really just for my own use: I would like to be able
Using Rails 2.3.11 , I'm creating a plugin for Redmine that add methods to
I have a plugin that needs to add something the the base Redmine layout.
I am not sure if this problem is a general Rails problem or Redmine
I've got a problem with a project repository setting in Redmine, in that; I've
this is my code that I write it but I want to use LINQ
I have to move Redmine to my local server. To achieve this, I installed
I'm creating a project using Django. For this project I use git and redmine
I have this method on rails so that I have an image calling a
Today I was trying to install Redmine on my shared hosting following this guide:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.