Loriowar / redmine_issues_tree

Provides a tree view of the Redmine issues list
GNU General Public License v3.0
115 stars 72 forks source link

Compatibility with redmine_tags #24

Closed monakov-y closed 8 years ago

monakov-y commented 8 years ago

The issue is the same as described in redmine_tags project: https://github.com/ixti/redmine_tags/issues/45 (and finally resolved in https://github.com/ande3577/redmine-graphs-plugin/issues/12) However, the solution which was proposed to redmine-graphs-plugin perfectly works with redmine_issues_tree. If I add

# WARNING: BIG HACK {{{
    IssuesController._helpers.included_modules.each do |mod|
      helper mod
    end
# }}}

to app/controllers/issues_trees_controller.rb then everything works without errors.

PS. It is really great plugin, thanks!

monakov-y commented 8 years ago

I've used redmine_issues_tree from the actual master with redmine 3.1 and latest redmine_tags.

Loriowar commented 8 years ago

As I understand, you need all helpers from Issue on tree_view page for correct works of functions from _redminetags plugin. But idea of tree_view is in separate controller and in some kind of independency from Issue. Because this view is only looks like default(plain) issues view, but in reality this is a separate part with own logic. Some actions from Issues are completely broken on _treeview, other one I'm not test yet. That is why I remove all helpers and action related with Issues, but doesn't needed for functionality of _treeview. If you want it and you really understand what you want you can patch IssuesTreesController and add anything what you need. But this is for you own risk.

Best way to patch controller is follows: looks at lib/redmine_issues_tree/issue_patch.rb file, make same one for IssuesTreesController and add you source code into included do section. After this you need to send this module to IssuesTreesController. This action you can do, for example, by the follows way. And thats all.

This approach is more acceptable, because you doesn't make a monkey-patch of source code of plugin and in future you can easily merge new changes into your local copy of plugin without any conflicts. But remember, in fact you make absolutely same actions as you described, but on more elegant way.

And thanks for using this plugin!