bap14 / redmine_category_tree

Module for Redmine to allow categories to be a tree instead of a single-list
19 stars 20 forks source link

Redmine 500 error (undefined method `issue_category_tree') #20

Open Gumis91 opened 8 years ago

Gumis91 commented 8 years ago

Hello, I'm having difficult time trying to use your plugin. As long as project have no categories, it's settings page is working fine. However, when I'm trying to add new category or open project with already exiting categories, Redmine 500 error occurs.

Message from system log:

Started GET "/projects/test_backend/settings/categories" for 10.132.182.41 at 2016-04-27 16:49:09 +0200
Processing by ProjectsController#settings as HTML
  Parameters: {"id"=>"test_backend", "tab"=>"categories"}
  Current user: kkuziel-admin (id=77)
  Rendered plugins/redmine_meeting_room_calendar/app/views/projects/_project_meeting_rooms.html.erb (0.7ms)
  Rendered projects/_form.html.erb (38.8ms)
  Rendered projects/_edit.html.erb (40.8ms)
  Rendered projects/settings/_modules.html.erb (12.9ms)
  Rendered projects/settings/_members.html.erb (21.5ms)
  Rendered plugins/advanced_roadmap_v2/app/views/projects/settings/_milestones.html.erb (2.5ms)
  Rendered projects/settings/_versions.html.erb (13.9ms)
  Rendered plugins/redmine_category_tree/app/views/projects/settings/_issue_categories.html.erb (564.8ms)
  Rendered common/_tabs.html.erb (665.0ms)
  Rendered projects/settings.html.erb within layouts/base (666.5ms)
Completed 500 Internal Server Error in 687ms (ActiveRecord: 14.7ms)

ActionView::Template::Error (undefined method 'issue_category_tree' for #<#<Class:0x000000052568e0>:0x007f5b39ed1458>):
    10:     <th></th>
    11:   </tr></thead>
    12:   <tbody>
    13: <% issue_category_tree(@project.issue_categories) do |category, level| %>
    14:   <% unless category.new_record? %>
    15:   <tr class="issue_category <%= cycle 'odd', 'even' %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
    16:     <td class="name"><span><%=h(category.name) %></span></td>
  app/views/common/_tabs.html.erb:22:in 'block in _437c7bed7810a622c4d4f1b69fd38128'
  app/views/common/_tabs.html.erb:21:in 'each'
  app/views/common/_tabs.html.erb:21:in '_437c7bed7810a622c4d4f1b69fd38128'
  app/helpers/application_helper.rb:321:in 'render_tabs'
  app/views/projects/settings.html.erb:3:in '_1c3d66c0fad385775d8e22882599a759'

Details of my installation:

  Redmine version                3.0.7.stable
  Ruby version                   2.2.4-p230 (2015-12-16) [x86_64-linux]
  Rails version                  4.2.3
  Environment                    production
  Database adapter               PostgreSQL
SCM:
  Git                            1.8.3.1
  Filesystem                     
Redmine plugins:
  a_common_libs                  2.0.0
  advanced_roadmap_v2            2.4.1
  copy_parent_issue_id           1.0.1
  event_notifications            3.0.0
  favorite_locations             0.0.1
  inline_edit_issues             0.0.1
  issue_votes                    0.2.0
  mega_calendar                  1.3.1
  redmine_agile                  1.3.12
  redmine_banner_notifications   0.0.1
  redmine_base_deface            0.0.1
  redmine_base_select2           4.0.0
  redmine_better_crossprojects   0.4
  redmine_category_tree          0.0.6
  redmine_checklists             3.1.3
  redmine_contacts               4.0.4
  redmine_custom_reports         3.1.0
  redmine_custom_values_projects 0.0.1
  redmine_custom_workflows       0.1.6
  redmine_dashboard              2.7.0
  redmine_default_custom_query   1.1.2
  redmine_default_subtask_tracker 0.2
  redmine_image_clipboard_paste  1.0.0
  redmine_improved_searchbox     0.0.3
  redmine_issue_tabs             1.1.1
  redmine_issue_templates        0.1.1
  redmine_logs                   0.1.0
  redmine_mail_reminder          3.0.0.0001
  redmine_meeting_room_calendar  3.0.0
  redmine_merge_redmine          0.0.1
  redmine_monitoring_controlling 0.1.1
  redmine_my_page                0.1.8
  redmine_pivot_table            0.0.2
  redmine_pretend                2.0.1
  redmine_questions              0.0.7
  redmine_related_issues         0.0.1
  redmine_scheduling_poll        1.3.0
  redmine_sidebar_toc_pt         1.7.0
  redmine_subtasks_inherited_fields 1.1.0
  redmine_tab                    0.4.0
  redmine_tags                   3.1.0
  redmine_timelog_updates_issue  0.1
  redmine_timesheet_plugin       0.7.0
  redmine_workflow_enhancements  0.5.0
  redmine_xls_export             0.2.1.t9
  redrisk                        1.0.1
  release_logs                   1.0.0
  tracker_hider                  0.0.1
  wiking                         1.1.0

Any ideas what may be causing this issue? Thanks in advance!

Shinjaewon commented 8 years ago

redmine_category_tree/app/views/projects/settings/_issue_categories.html.erb

1line add code <% self.class.send(:include, RedmineCategoryTree::IssueCategoryHelper) -%>

aozhi2nd commented 6 years ago

add under line 12