TravisSpangle / redmine_spent_time_in_issue_description

Redmine Plugin that drops Time Entry data into the Issue Description
16 stars 17 forks source link

missing function error #9

Closed gtstewart closed 9 years ago

gtstewart commented 10 years ago

Your plugin currently generates an undefined method error for 'is_spent_on_shown', when trying to display an issue with time spent records. It would appear that the methods defined in issue_helper_patch.rb are not loaded when the plugin is initialized or not in the correct path.

Rendered plugins/redmine_spent_time_in_issue_description/app/views/spent_time/_javascript_report.html.erb (149.3ms) Completed 500 Internal Server Error in 432.7ms

ActionView::Template::Error (undefined method is_spent_on_shown' for #<#<Class:0x00000007305a00>:0x0000000822e9f0>): 13: <% @issue.time_entries.last( Setting.plugin_redmine_spent_time_in_issue_description['spent_time_max_display'].to_i ).each_with_index do |entry, index| %> 14: <%= "," if index > 0 %> { 15: 16: <%=raw '"spent_on":"' << entry.spent_on.strftime("%m/%d/%Y") << '",' if is_spent_on_shown( entry ) %> 17: <%=raw '"user":"' << entry.user.to_s << '",' if is_user_shown( entry ) %> 18: <%=raw '"hours":"' << report_time_spent( entry ) << '",' if is_report_time_shown( entry ) %> 19: <%=raw '"activity":"' << entry.activity.to_s << '",' if is_activity_shown( entry ) %> lib/redmine/hook.rb:111:inblock in render_on' lib/redmine/hook.rb:61:in block (2 levels) in call_hook' lib/redmine/hook.rb:61:ineach' lib/redmine/hook.rb:61:in block in call_hook' lib/redmine/hook.rb:58:intap' lib/redmine/hook.rb:58:in call_hook' lib/redmine/hook.rb:158:incall_hook' app/views/layouts/base.html.erb:14:in _app_views_layouts_base_html_erb___3633671744932232525_56692100' app/controllers/issues_controller.rb:128:inblock (2 levels) in show' app/controllers/issues_controller.rb:125:in `show'

I assume that init.rb is supposed to register issue_helper_patch.rb with redmine, but am not familiar with ruby, rails or redmine plugin developement so I can not provide any further diagnostics.

I am using: Redmine version 2.5.2.stable.13335 Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux] Rails version 3.2.19 Environment production Database adapter Mysql2

Thanks

Graham

TravisSpangle commented 9 years ago

I"m unable to reproduce this error. It seems that the IssueHelper patch isn't being loaded.

Have you run the install task rake redmine:plugins:migrate?

Can you switch to the http://svn.redmine.org/redmine/tags/2.5.0 or 2.6.0 repositories and confirm if it's an issue?

gtstewart commented 9 years ago

I initially messed up the install and did not run rake before I accessed the pages that should have used the extension so I uninstalled and reinstalled making sure I ran rake the second time. I also had an error message about the public dir not being accessible on the first attempt which I fixed before the second attempt.

I am not really a supporter of Ruby on Rails, I have broken several installed application trying to upgrade them, so if it does not work first time, I do not bother wasting time trying to fix them.

I may have a look at the problem later or wait for another plugin.

Graham

hsychla commented 9 years ago

Sorry for hijacking a closed issue but I am experiencing the same (?) error and had to remove the plugin to be able to view issues again:

Started GET "/issues/3217" for 127.0.0.1 at 2015-04-08 09:57:49 +0200
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"3217"}
  Current user: hsychla (id=4)
  Rendered issues/_action_menu.html.erb (25.2ms)
  Rendered plugins/advanced_roadmap_v2/app/views/hooks/issues/_show.html.erb (2.0ms)
  Rendered plugins/redmine_contacts/app/views/deals_issues/_show.html.erb (1.4ms)
  Rendered plugins/redmine_tags/app/views/issues/_tags.html.erb (2.1ms)
  Rendered plugins/redmine_contacts_helpdesk/app/views/issues/_ticket_data.html.erb (10.4ms)
  Rendered plugins/redmine_products/app/views/products_issues/_products.html.erb (3.1ms)
  Rendered attachments/_links.html.erb (4.5ms)
  Rendered plugins/redmine_checklists/app/views/issues/_checklist.html.erb (1.0ms)
  Rendered plugins/redmine_spent_time_in_issue_description/app/views/issues/_time_spent_report.html.erb (71.8ms)
  Rendered plugins/redmine_spent_time_in_issue_description/app/views/issues/show.html.erb within layouts/base (146.0ms)
Completed 500 Internal Server Error in 262.9ms

ActionView::Template::Error (undefined method `spent_on_shown?' for #<#<Class:0x00000002ce15b0>:0x00000000ef12f8>):
    15:   <tbody>
    16:     <% @issue.time_entries.last( Setting.plugin_redmine_spent_time_in_issue_description['spent_time_max_display'].to_i ).each do |entry| %>
    17:       <tr>
    18:         <%= content_tag(:td, format_date( entry.spent_on ) ) if spent_on_shown? %>
    19:         <%= content_tag(:td, link_to_user( entry.user )) if user_shown? %>
    20:         <%= content_tag(:td, report_time_spent(entry) ) if report_time_shown? %>
    21:         <%= content_tag(:td, entry.comments ) if comment_shown? %>
  app/controllers/issues_controller.rb:128:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:125:in `show'

Our system is:

Environment:
  Redmine version                2.6.3.stable.14155
  Ruby version                   2.1.2-p95 (2014-05-08) [x86_64-linux]
  Rails version                  3.2.21
  Environment                    production
  Database adapter               PostgreSQL
SCM:
  Subversion                     1.8.8
  Git                            1.9.1
  Filesystem                     
Redmine plugins:
  advanced_roadmap_v2            2.4.0
  redmine_agile                  1.3.8
  redmine_checklists             3.0.4
  redmine_contacts               3.4.5
  redmine_contacts_google_sync   2.0.3
  redmine_contacts_helpdesk      2.4.0
  redmine_contacts_invoices      3.3.0
  redmine_contacts_money_exchange 1.1.1
  redmine_finance                1.2.1
  redmine_ics_export             3.0.0.dev
  redmine_leaves                 0.1.0
  redmine_mentions               0.0.1
  redmine_people                 0.1.8
  redmine_products               1.1.0
  redmine_questions              0.0.5
  redmine_tags                   2.0.1-dev
  redmine_timesheet_plugin       0.7.0
  redmine_update_reminder        1.0.1
  redmine_zenedit                0.0.2
  wiki_external_filter           0.0.2

Any idea what's missing/wrong?

TravisSpangle commented 9 years ago

Thanks for reporting this hsychla. I think its a conflict with one of your plugins. The error "undefined method `spent_on_shown?'" seems to be the first thing thrown when somethings not right.

Can you please open another issue with your post? That will help give it visibility.

hsychla commented 9 years ago

Done: https://github.com/TravisSpangle/redmine_spent_time_in_issue_description/issues/20