Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin installation error: undefined method "visible_details" #42

Open
tolikkk opened this issue Mar 13, 2014 · 10 comments
Open

plugin installation error: undefined method "visible_details" #42

tolikkk opened this issue Mar 13, 2014 · 10 comments

Comments

@tolikkk
Copy link

tolikkk commented Mar 13, 2014

Hello.

I use redmine 2.3.2 and I'm trying to install plugin redmine_issue_detailed_tabs_time v. 0.1.0, but unfortunately have no success. After copying plugin datafiles to redmine's plugins folder and restaring redmine I have "Internal error" on any issue's page (non-issue pages seems to work fine).

In the production.log there is an error: ActionView::Template::Error (undefined method `visible_details' for #Journal:0x0000001f6bab10)

Here is the full log for my request:

Started GET "/issues/19" for 192.168.17.24 at 2014-03-06 10:16:26 +0400
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"19"}
  Current user: admin (id=1)
  Rendered issues/_action_menu.html.erb (3.1ms)
  Rendered issue_relations/_form.html.erb (1.2ms)
  Rendered issues/_relations.html.erb (2.0ms)
  Rendered plugins/redmine_issue_detailed_tabs_time/app/views/issues/_history.html.erb (13.1ms)
  Rendered issues/show.html.erb within layouts/base (31.2ms)
Completed 500 Internal Server Error in 142ms

ActionView::Template::Error (undefined method `visible_details' for #<Journal:0x0000001f6bab10>):
    23:         </ul>
    24: </div>
    25:
    26: <%= c = draw_entries_in_issue_history_tab(entries, journals).html_safe %>
    27: <% end %>
    28: <% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, issue.project) || User.current.allowed_to?(:edit_own_issue_notes, issue.project) %>
  app/views/issues/show.html.erb:120:in `_app_views_issues_show_html_erb__3768112807332056880_267822040'
  app/controllers/issues_controller.rb:119:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:116:in `show'

Have you any suggestion, how to make it works?

@markedagain
Copy link

you are correct, looking at the 2.3.x branche on redmine shows that visible_details is not a function in the journal model and was added in 2.4.x i will try to get a backward compatibility out soon for this

@markedagain
Copy link

Also in mean time, you can undo these changes to fix your issue
6cda084

@tolikkk
Copy link
Author

tolikkk commented Mar 13, 2014

I replaced lines 101-103 in ...lib/issue_detailed_tabs_time_issues_helper_patch.rb:

if (journal.visible_details.any?) && User.current.allowed_to?(:view_activity,@project,:global => true)
c << "<ul class='details'>"
details_to_strings(journal.visible_details).each do |string|

After restarting redmine I have the same error:

Started GET "/issues/418" for 192.168.17.24 at 2014-03-13 19:32:59 +0400
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"418"}
  Current user: tolik (id=4)
  Rendered issues/_action_menu.html.erb (6.9ms)
  Rendered issue_relations/_form.html.erb (2.9ms)
  Rendered issues/_relations.html.erb (6.0ms)
  Rendered plugins/redmine_issue_detailed_tabs_time/app/views/issues/_history.html.erb (22.6ms)
  Rendered issues/show.html.erb within layouts/base (72.4ms)
Completed 500 Internal Server Error in 330ms

ActionView::Template::Error (undefined method `visible_details' for #<Journal:0x0000000b1ca6f0>):
    23:         </ul>
    24: </div>
    25:
    26: <%= c = draw_entries_in_issue_history_tab(entries, journals).html_safe %>
    27: <% end %>
    28: <% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, issue.project) || User.current.allowed_to?(:edit_own_issue_notes, issue.project) %>
  app/views/issues/show.html.erb:120:in `_app_views_issues_show_html_erb__2984423690149623929_88351640'
  app/controllers/issues_controller.rb:119:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:116:in `show'

@markedagain
Copy link

you need to change the journal.visible_details to journal.details
both line 101 and 103

@tolikkk
Copy link
Author

tolikkk commented Mar 14, 2014

Yes, you are right, now it's OK, tabs are appeared in issues.

changes in file:

if (journal.details.any?) && User.current.allowed_to?(:view_activity,@project,:global => true)
c << "<ul class='details'>"
details_to_strings(journal.details).each do |string|

Thanks a lot!

@markedagain
Copy link

glad it works @tolikkk , im going to leave the ticket open as i need to make a backward compatibly for this function call

@fanyangxi
Copy link

I'm having the same issue, and your solution works perfect. Thank you guys for the great job!

@eskuai
Copy link

eskuai commented Jun 26, 2014

changed...

        if (journal.details.any?) && User.current.allowed_to?(:view_activity,@project,:global => true)
          c << "<ul class='details'>"
            details_to_strings(journal.details).each do |string|
            c << "<li>" + string + "</li>"
            end
          c << "</ul>"

failed:

ActionView::Template::Error (undefined method visible_details' for #<Journal:0x7f0303c23e60>): 23: </ul> 24: </div> 25: 26: <%= c = draw_entries_in_issue_history_tab(entries, journals).html_safe %> 27: <% end %> 28: <% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, issue.project) || User.current.allowed_to?(:edit_own_issue_notes, issue.project) %> app/views/issues/show.html.erb:120:in_app_views_issues_show_html_erb___339909493_69825462613860'
app/controllers/issues_controller.rb:119:in show' app/controllers/issues_controller.rb:116:inshow'

@markedagain
Copy link

did you restart you service ? according to the error the function call visible_details is still in that file

@eskuai
Copy link

eskuai commented Jun 26, 2014

you right, ... i made a mistake into service apache"2" restart ...
great , thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants