Restream / redmine_tagging

Add simple tagging support to Redmine Issues/Wiki pages
113 stars 52 forks source link

undefined method `tag_cloud_in_project' #39

Open shuozhifenxi opened 11 years ago

shuozhifenxi commented 11 years ago

I got a error when I want to see a wiki page with tag cloud.

Here is the error log

ActionView::Template::Error (undefined method tag_cloud_in_project' for #<#<Class:0x00000006436060>:0x000000063e3568>): 2: 3: <div id='tagcloud'> 4: <% 5: tag_cloud_in_project(@project) do |tag, factor| 6: options = {:style => "font-size: #{10 * factor + 9}pt" } 7: %> 8: <%= link_to(tag, {:controller => "search", :action => "index", :id => @project, :q => "\"#{tag}\"", :wiki_pages => true }, options) %> lib/redmine/hook.rb:61:inblock (2 levels) in call_hook' lib/redmine/hook.rb:61:in each' lib/redmine/hook.rb:61:inblock in call_hook' lib/redmine/hook.rb:58:in tap' lib/redmine/hook.rb:58:incall_hook' lib/redmine/hook.rb:158:in call_hook' app/views/layouts/base.html.erb:14:in_app_views_layouts_base_html_erb__2977685098691491769_43105820' app/controllers/wiki_controller.rb:98:in `show'

nettsundere commented 11 years ago

I think i have fixed this issue recently, please try latest version from master branch. tag_cloud_in_project should be available for any controller now, as soon it is defined inside a application_controller helper.

asyncopation commented 11 years ago

I'm still encountering this issue on latest master after Redmine upgrade to 2.2.3

ActionView::Template::Error (undefined method tag_cloud_in_project' for #<#<Class:0x7f4631832b00>:0x7f4631742420>): 2: 3: <div id='tagcloud'> 4: <% 5: tag_cloud_in_project(@project) do |tag, factor| 6: options = {:style => "font-size: #{10 * factor + 9}pt" } 7: %> 8: <%= link_to_project_tag_filter(@project, tag, {}, options) %> lib/redmine/hook.rb:61:insend' lib/redmine/hook.rb:61:in call_hook' lib/redmine/hook.rb:61:ineach' lib/redmine/hook.rb:61: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/issues/_sidebar.html.erb:14:in _app_views_issues__sidebar_html_erb__1016645701_69969727356620' app/views/issues/index.html.erb:93:in_app_views_issues_index_html_erb_1695335609_69969727540860' app/helpers/application_helper.rb:1192:in content_for' app/views/issues/index.html.erb:92:in_app_views_issues_index_htmlerb1695335609_69969727540860' app/controllers/issues_controller.rb:83:in index' app/controllers/issues_controller.rb:82:inindex'

E3pO commented 10 years ago

I'm having this problem too, anybody have a fix for this yet?

Environment: Redmine version 2.3.1.stable.11898 Ruby version 1.9.3 (x86_64-linux) Rails version 3.2.13 Environment production Database adapter Mysql2

Started GET "/issues/13311" for 192.168.240.83 at 2013-09-04 16:04:40 -0400 Processing by IssuesController#show as HTML Parameters: {"id"=>"13311"} Current user: wreiske (id=157) Rendered issues/_action_menu.html.erb (6.5ms) Rendered plugins/redmine_tags/app/views/issues/_tags.html.erb (9.0ms) Rendered plugins/redmine_issue_checklist/app/views/issues/_checklist.html.erb (3.8ms) Rendered issue_relations/_form.html.erb (2.2ms) Rendered issues/_relations.html.erb (4.0ms) Rendered issues/_history.html.erb (30.1ms) Rendered issues/_action_menu.html.erb (5.4ms) Rendered issues/_form_custom_fields.html.erb (18.7ms) Rendered issues/_attributes.html.erb (179.5ms) Rendered plugins/redmine_issue_checklist/app/views/issues/_checklist_form.html.erb (2.2ms) Rendered plugins/redmine_tags/app/views/issues/_tags_form.html.erb (3.4ms) Rendered issues/_form.html.erb (335.8ms) Rendered attachments/_form.html.erb (2.5ms) Rendered issues/_edit.html.erb (354.2ms) Rendered plugins/redmine_contacts/app/views/issues/_contacts.html.erb (14.0ms) Rendered plugins/redmine_issue_templates/app/views/issue_templates/_issue_template_link.html.erb (0.2ms) Rendered plugins/redmine_tagging/app/views/tagging/_tagcloud.erb (533.7ms) Rendered issues/_sidebar.html.erb (551.6ms) Rendered issues/show.html.erb within layouts/base (1106.7ms) Completed 500 Internal Server Error in 1168ms

ActionView::Template::Error (undefined method tag_cloud_in_project' for #<#<Class:0x0000000689f778>:0x007f60e5b8e000>): 2: 3: <div id='tagcloud'> 4: <% 5: tag_cloud_in_project(@project) do |tag, factor| 6: options = {:style => "font-size: #{10 * factor + 9}pt" } 7: %> 8: <%= link_to_project_tag_filter(@project, tag, {}, options) %> lib/redmine/hook.rb:61:inblock (2 levels) in call_hook' lib/redmine/hook.rb:61:in each' lib/redmine/hook.rb:61:inblock in call_hook' lib/redmine/hook.rb:58:in tap' lib/redmine/hook.rb:58:incall_hook' lib/redmine/hook.rb:158:in call_hook' app/views/issues/_sidebar.html.erb:14:in_app_views_issues__sidebar_html_erb_3743965039936802699_70027067249840' app/views/issues/show.html.erb:144:in `block in _app_views_issues_show_htmlerb4441135716372900774_54944080' app/helpers/application_helper.rb:1149:incontent_for' app/views/issues/show.html.erb:143:in_app_views_issues_show_html_erb___4441135716372900774_54944080' app/controllers/issues_controller.rb:119:inblock (2 levels) in show' app/controllers/issues_controller.rb:116:inshow'

geraldo7junior commented 9 years ago

I think that is a plugin helper issue. The TaggingHelper module that is defined in app/helpers/tagging_helper.rb isn't correctly included (4 some reason :sweat_smile: ) on application's path.

To 'solve' it, I just included that piece of code on init.rb

require File.expand_path('../app/helpers/tagging_helper', __FILE__)
ActionView::Base.send :include, TaggingHelper

That obviously is not the best solution, but it works for me.