Feature #783


Real Plugin-System

Added by Martin Herr about 16 years ago. Updated over 9 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


I think it would be extremely useful to have a "real plugin-system" integrated into redmine core. Based on this, it should be possible to modify routing,controllers,models,views,helpers and even core functions.

At the moment it's hard to build extensions without patching the core and even the engines-plugin is just an unstable workaround for me :(

I'm one of the developers of and would like to contribute my redmine modifications - but I can't do this by contributing hundreds of patches. There should be a clean way for everyone to extend redmine by developing plugins.

Maybe it makes sense to look at the mephisto guys and how they implemented their plugin-system:

Any other ideas?

Related issues

Related to Redmine - Feature #1143: Hooks for pluginsClosed2008-04-29

Related to Redmine - Patch #1677: Plugin hook APIClosed2008-07-24

Actions #1

Updated by Eric Davis about 16 years ago

Actually Mephisto is in the process of throwing their plugin system away and using Engines instead. You should be able to create a Redmine or Rails plugin to override anything in Redmine without changing the core.

Actions #2

Updated by Martin Herr about 16 years ago

Hey Eric,

I really tried to overload existing redmine-views and -controllers with engines for several days - but couldn't get it to work.. :(

Will try it again :)

@Jean-Philippe: Would it be possible that I could get write access to that I can add some documentation about my experiences writing redmine plugins?

Actions #3

Updated by Rocco Stanzione about 16 years ago

+1. As the Engines docs say, you can't really clobber models with a plugin - you'd have to copy the whole existing model into the plugin, which kind of defeats the purpose. I was able to get it to work for one page load with some evil hackery, but at the end Rails insists on loading the original plugin.

Actions #4

Updated by Brian Palmer about 16 years ago


I have to disagree. I'm working on a Redmine plugin and the engines system has worked very well, I think a "real" plugin system would require a huge amount of effort to even reach the same level. Models can be a problem, true, but it's not difficult to inject code into existing models in the plugin initialization code. I added a new has_many association to projects in this way. Some problems can occur in development mode because of reloading, but they can be worked around.

Actions #5

Updated by Jean-Philippe Lang about 16 years ago

Martin Liu: you should be able to edit the wiki now.

Actions #6

Updated by Chaoqun Zou almost 16 years ago

Hi, Brian.
Could you tell us how to do this? "I added a new has_many association to projects in this way."

Actions #7

Updated by Eric Davis almost 16 years ago

chaoqun zou wrote:

Hi, Brian.
Could you tell us how to do this? "I added a new has_many association to projects in this way."

This code is working great for me. As you can see in the ClassMethods and InstanceMethods modules, you can easily add or override methods in the Redmine core.

# init.rb
require_dependency 'issue_patch'
# issue_patch.rb
require_dependency 'issue'

module IssuePatch
  def self.included(base) # :nodoc:

    base.send(:include, InstanceMethods)

    # Same as typing in the class 
    base.class_eval do
      belongs_to :my_plugin_class


  module ClassMethods   
    # Methods to add to the Issue class

  module InstanceMethods
    # Methods to add to specific issue objects

# Add module to Issue
Issue.send(:include, IssuePatch)

Actions #8

Updated by Eric Davis over 15 years ago

  • Status changed from New to Closed
  • Assignee deleted (Jean-Philippe Lang)
  • Target version set to 0.8
  • % Done changed from 0 to 100

I'm going to close this issue. #1677 added some plugin hooks so plugins can start to add in their own HTML or controller logic. r1723 lets any plugin override a view by creating the same named view file.

If any more hooks are needed; open a issue describing where you would like it, what data you would like, and assign it to me.


Actions #9

Updated by Thiyagarajan Thulasi over 9 years ago

In my redmine application i added some plugins while overriding a same patch in different plugin but it take priority with the top level i unable to run my bottom plugin patch.

For Example:

Plugin 'A'   Am writing patch for issues controller and issue before_save callBack
plugin 'B' Am overriding same issue controller patch and model before_save callBack

The above scenario Plugin 'A' patch's only running plugin 'B' code does't run

Any one have any solution for this?

Actions #10

Updated by Toshi MARUYAMA over 9 years ago

Thiyagarajan Thulasi wrote:


FTR: #19019.


Also available in: Atom PDF