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

not compatible with redmine_blocked_reason #50

Open archonwang opened 7 years ago

archonwang commented 7 years ago

@Loriowar , installed redmine_blocked_reason, and foun they're not compatible each other, please help to check it. (https://github.com/zitec/redmine_blocked_reason)

related issues: https://github.com/zitec/redmine_blocked_reason/issues/14

Thanks.

error logs

Started POST "/projects/demo/issues_trees/redirect_with_params" for 192.168.20.231 at 2017-04-25 19:34:04 +0800
Processing by IssuesTreesController#redirect_with_params as JSON
  Parameters: {"utf8"=>"?", "set_filter"=>"1", "f"=>["status_id", ""], "op"=>{"status_id"=>"o"}, "c"=>["tracker", "subject", "status", "author", "assigned_to", "priority", "updated_on", "due_date"], "group_by"=>"", "t"=>["estimated_hours", "spent_hours", ""], "project_id"=>"demo"}
  Current user: hui.wang (id=8)
Completed 200 OK in 12ms (Views: 0.2ms | ActiveRecord: 2.6ms)
Started GET "/projects/demo/issues_trees/tree_index?c%5B%5D=tracker&c%5B%5D=subject&c%5B%5D=status&c%5B%5D=author&c%5B%5D=assigned_to&c%5B%5D=priority&c%5B%5D=updated_on&c%5B%5D=due_date&f%5B%5D=status_id&f%5B%5D=&group_by=&op%5Bstatus_id%5D=o&project_id=demo&set_filter=1&t%5B%5D=estimated_hours&t%5B%5D=spent_hours&t%5B%5D=" for 192.168.20.231 at 2017-04-25 19:34:04 +0800
Processing by IssuesTreesController#tree_index as HTML
  Parameters: {"c"=>["tracker", "subject", "status", "author", "assigned_to", "priority", "updated_on", "due_date"], "f"=>["status_id", ""], "group_by"=>"", "op"=>{"status_id"=>"o"}, "project_id"=>"demo", "set_filter"=>"1", "t"=>["estimated_hours", "spent_hours", ""]}
  Current user: hui.wang (id=8)
STATEMENT projects.id = 1 AND (issues.status_id IN (SELECT id FROM issue_statuses WHERE is_closed=0))
STATEMENT projects.id = 1 AND (issues.status_id IN (SELECT id FROM issue_statuses WHERE is_closed=0))
  Rendered plugins/redmine_issues_tree/app/views/issues_trees/_link_to_plain_view.html.haml (0.7ms)
Read fragment views/queries/filter/user-8/2017-04-20T06:45:51Z/2017-04-25 07:14:16 UTC/e42c5980be4ccd0f7205b2df55f850cf (0.2ms)
  Rendered plugins/redmine_performance/app/views/queries/_filters.html.erb (8.5ms)
  Rendered queries/_columns.html.erb (3.5ms)
  Rendered plugins/redmine_issues_tree/app/views/issues_trees/_tree_node.html.haml (1104.2ms)
  Rendered plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml (1115.0ms)
  Rendered plugins/redmine_issues_tree/app/views/issues_trees/tree_index.html.haml within layouts/base (1136.9ms)
Completed 500 Internal Server Error in 1249ms (ActiveRecord: 21.5ms)

ActionView::Template::Error (undefined method `render_blocked_reason_tag' for #<#<Class:0x000000051f33f8>:0x007fe87d8ff648>):
    12:     = link_to issue.id, controller: 'issues', action: 'show', id: issue
    13:   - cols = query.inline_columns.map do |column|
    14:     - unless column.value(issue) == issue.id
    15:       - content_tag 'td', column_content(column, issue), class: column.css_classes
    16:   = raw cols.join
  plugins/redmine_blocked_reason/lib/redmine_blocked_reason/patches/queries_helper_patch.rb:17:in `column_value_with_blocked_reason_tag'
  app/helpers/queries_helper.rb:134:in `column_content'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_node.html.haml:15:in `block in _e25dc3bf17a7b13a4e1e22be921192a7'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_node.html.haml:13:in `map'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_node.html.haml:13:in `_e25dc3bf17a7b13a4e1e22be921192a7'
  plugins/redmine_workflow_enhancements/lib/workflow_enhancements/patches/action_view_rendering.rb:53:in `render_with_workflow_enhancements'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml:24:in `block (2 levels) in _0b0eef26e4f32c9291e516482e7affcd'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml:23:in `each'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml:23:in `block in _0b0eef26e4f32c9291e516482e7affcd'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml:11:in `_0b0eef26e4f32c9291e516482e7affcd'
  plugins/redmine_workflow_enhancements/lib/workflow_enhancements/patches/action_view_rendering.rb:53:in `render_with_workflow_enhancements'
  plugins/redmine_issues_tree/app/views/issues_trees/tree_index.html.haml:75:in `_424ff0b1702ea603d118f238d7499477'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Started GET "/projects/demo/issues_trees/tree_index?c%5B%5D=tracker&c%5B%5D=subject&c%5B%5D=status&c%5B%5D=author&c%5B%5D=assigned_to&c%5B%5D=priority&c%5B%5D=updated_on&c%5B%5D=due_date&f%5B%5D=status_id&f%5B%5D=&group_by=&op%5Bstatus_id%5D=o&project_id=demo&set_filter=1&t%5B%5D=estimated_hours&t%5B%5D=spent_hours&t%5B%5D=" for 192.168.20.231 at 2017-04-25 19:34:05 +0800
Processing by IssuesTreesController#tree_index as */*
  Parameters: {"c"=>["tracker", "subject", "status", "author", "assigned_to", "priority", "updated_on", "due_date"], "f"=>["status_id", ""], "group_by"=>"", "op"=>{"status_id"=>"o"}, "project_id"=>"demo", "set_filter"=>"1", "t"=>["estimated_hours", "spent_hours", ""]}
  Current user: hui.wang (id=8)
STATEMENT projects.id = 1 AND (issues.status_id IN (SELECT id FROM issue_statuses WHERE is_closed=0))
STATEMENT projects.id = 1 AND (issues.status_id IN (SELECT id FROM issue_statuses WHERE is_closed=0))
  Rendered plugins/redmine_issues_tree/app/views/issues_trees/_link_to_plain_view.html.haml (0.7ms)
Read fragment views/queries/filter/user-8/2017-04-20T06:45:51Z/2017-04-25 07:14:16 UTC/e42c5980be4ccd0f7205b2df55f850cf (0.3ms)
  Rendered plugins/redmine_performance/app/views/queries/_filters.html.erb (8.1ms)
  Rendered queries/_columns.html.erb (3.3ms)
  Rendered plugins/redmine_issues_tree/app/views/issues_trees/_tree_node.html.haml (1543.3ms)
  Rendered plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml (1553.8ms)
  Rendered plugins/redmine_issues_tree/app/views/issues_trees/tree_index.html.haml within layouts/base (1575.3ms)
Completed 500 Internal Server Error in 1689ms (ActiveRecord: 22.6ms)

ActionView::Template::Error (undefined method `render_blocked_reason_tag' for #<#<Class:0x000000051f33f8>:0x0000000b491028>):
    12:     = link_to issue.id, controller: 'issues', action: 'show', id: issue
    13:   - cols = query.inline_columns.map do |column|
    14:     - unless column.value(issue) == issue.id
    15:       - content_tag 'td', column_content(column, issue), class: column.css_classes
    16:   = raw cols.join
  plugins/redmine_blocked_reason/lib/redmine_blocked_reason/patches/queries_helper_patch.rb:17:in `column_value_with_blocked_reason_tag'
  app/helpers/queries_helper.rb:134:in `column_content'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_node.html.haml:15:in `block in _a853942285bf843368126a11f0fa1ab5'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_node.html.haml:13:in `map'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_node.html.haml:13:in `_a853942285bf843368126a11f0fa1ab5'
  plugins/redmine_workflow_enhancements/lib/workflow_enhancements/patches/action_view_rendering.rb:53:in `render_with_workflow_enhancements'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml:24:in `block (2 levels) in _0720dd6620541a2bdf5d9b240fc02ed8'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml:23:in `each'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml:23:in `block in _0720dd6620541a2bdf5d9b240fc02ed8'
  plugins/redmine_issues_tree/app/views/issues_trees/_tree_list.html.haml:11:in `_0720dd6620541a2bdf5d9b240fc02ed8'
  plugins/redmine_workflow_enhancements/lib/workflow_enhancements/patches/action_view_rendering.rb:53:in `render_with_workflow_enhancements'
  plugins/redmine_issues_tree/app/views/issues_trees/tree_index.html.haml:75:in `_c26dbd1fbdffad29a86e2dd7a2fec8b9'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Loriowar commented 7 years ago

As I see from logs, the plugin redmine_blocked_reason add a new column in issues list, but my custom controller do not know anything about this. As a solution, I see a patch of my IssuesTreesController from redmine_blocked_reason and add there a helper IssuesBlockedReasonHelper. So, in redmine_blocked_reason we must check if exist constant IssuesTreesController and if so, add proper helper into this controller. Moreover, we must remember about an order of plugin loading and redmine_isses_tree must be loaded before redmine_blocked_reason.

Honestly speaking, there is a second way:

But this variant is not so good. Because there is no needs in all helper from IssuesController in IssuesTreesController and preferable to add only really needed one due to speed and potential problems in case of method names intersection.