dynamo-media / redmine_issue_detailed_tabs_time

30 stars 24 forks source link

ActionView::Template::Error (no implicit conversion of nil into String) when viewing issue #35

Closed cforce closed 10 years ago

cforce commented 10 years ago

ActionView::Template::Error (no implicit conversion of nil into String): 23: 24:

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__288442100_117557320' app/controllers/issues_controller.rb:119:inblock (2 levels) in show' app/controllers/issues_controller.rb:116:in `show'

cforce commented 10 years ago

same with "https://github.com/ande3577/redmine_issue_detailed_tabs_time" changes

cforce commented 10 years ago

The Problem raises in https://github.com/markedagain/redmine_issue_detailed_tabs_time/blob/master/lib/issue_detailed_tabs_time_issues_helper_patch.rb#L96,

journal.user is set and !=nil

markedagain commented 10 years ago

what scenario do u have so i can reproduce the issue ?

markedagain commented 10 years ago

@cforce are u still experiencing this issue ?

thej4ck commented 10 years ago

i'm experiencing it. how can i help?

ActionView::Template::Error (no implicit conversion of nil into String): 23: 24:

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__1312968320527901260_67389720' app/controllers/issues_controller.rb:119:inblock (2 levels) in show' app/controllers/issues_controller.rb:116:in `show'

markedagain commented 10 years ago

do you have steps to be able to reproduce it ?

thej4ck commented 10 years ago

how can i trace better the error?

thej4ck commented 10 years ago

Started GET "/issues/354" for 172.21.0.117 at 2013-11-12 16:06:22 +0100 Processing by IssuesController#show as HTML Parameters: {"id"=>"354"} Current user: name.surname (id=3) Rendered issues/_action_menu.html.erb (5.0ms) Rendered plugins/redmine_contacts_helpdesk/app/views/issues/_ticket_data.html.erb (5.3ms) Rendered plugins/redmine_milestones/app/views/hooks/milestones/_view_issues_show_details_bottom.html.erb (0.1ms) Rendered plugins/redmine_issue_checklist/app/views/issues/_checklist.html.erb (1.3ms) Rendered issue_relations/_form.html.erb (0.9ms) Rendered issues/_relations.html.erb (4.3ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.9ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (1.1ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.8ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.8ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (0.7ms) Rendered plugins/redmine_contacts_helpdesk/app/views/journals/_journal_contact.html.erb (3.9ms) Rendered plugins/redmine_issue_detailed_tabs_time/app/views/issues/_history.html.erb (167.5ms) Rendered issues/show.html.erb within layouts/base (207.5ms) Completed 500 Internal Server Error in 311ms

thej4ck commented 10 years ago

i'm not able to say how to reproduce it. It seems that the problem emerge only with some kind of issue.

thej4ck commented 10 years ago

can be a problem with a journal entry made by an "anonymous" user?

thej4ck commented 10 years ago

Confirmed: problem is when a journal entry is made by an "anonymous" user.

markedagain commented 10 years ago

oh maybe, ill see if i can test that out

markedagain commented 10 years ago

i can fix tonight the issue with the anonymous users, as for #14 i will see if it relates to it, but i dont think it does, from what i understand the issue for that one is having 2 different plugins trying to overwrite the same template.

thej4ck commented 10 years ago

thanx a lot! for the #14 i was thinking in that way because i've got the same plugins and one of this is responsable of generating a lot of anonymous journal entries, and the symptoms is the same: error 500 on the /issue/#id request

markedagain commented 10 years ago

you going to have to give me a few more days sorry, just overwhelmed at work this week. maybe one of the other contributors might beat me to it, would be great, hint hint ;)

cforce commented 10 years ago

@thej4ck which plugin is creating this anonmous entries?

thej4ck commented 10 years ago

helpdesk, by redminecrm, http://redminecrm.com/projects/helpdesk/pages/1

cforce commented 10 years ago

ahh, i use that too!

thej4ck commented 10 years ago

@cforce didn't u experiment the same issue?

cforce commented 10 years ago

I reported THIS bug ;)

thej4ck commented 10 years ago

any news?

markedagain commented 10 years ago

got no easy way to test as i dont have help desk. i might branch off an attempt of fix and see if ppl can test it out soon enough

thej4ck commented 10 years ago

i'll test it out. no problem.

thej4ck commented 10 years ago

u can reproduce the problem assigning a journal entry to the anonymous user_id (just change id in the journal table), in my case the id is "2", and i think for most of the installations is the same) and then open the issue relative to the journal entry.

markedagain commented 10 years ago

https://www.dropbox.com/s/rmya7710tbufea3/Capture.PNG

i got no error :(

cforce commented 10 years ago

I only have private projects and using mongruel Server for testing.

markedagain commented 10 years ago

@thej4ck was there anything else im supposed to change to reproduce the issue ? i wonder if its a rails version specific issue

thej4ck commented 10 years ago

I've not explained myself. Is not a metter of who is assigned to the issue, but who is assegned to the journal. Look at the image: redmine_journals_ - heidisql 8 1 0 4545

Try to look also at this image: 2013-12-04 14_17_23 this is how i can get the journal-id.

Try to change to "2" the user_id column of the redmine.journal table.

markedagain commented 10 years ago

ok , great explanation, i found the culprit to be on line 96 of issue_detailed_tabs_time_issues_helper_patch c << avatar(journal.user, :size => "24")

what avatar is supposed to show up for anonymous users ?

thej4ck commented 10 years ago

Normally anonymous users does not show avatars. Thx.

Nicola Mondinelli

Il giorno 09/dic/2013, alle ore 17:40, markedagain notifications@github.com ha scritto:

ok , great explanation, i found the culprit to be on line 96 of issue_detailed_tabs_time_issues_helper_patch c << avatar(journal.user, :size => "24")

what avatar is supposed to show up for anonymous users ?

— Reply to this email directly or view it on GitHub.

markedagain commented 10 years ago

ya i got a fix for this, but as im not to strong in ruby, im making a presumption that anonymous user is always id 2 you think this is a good presumption? or should i dig into figuring out how to check for anonymous ?

markedagain commented 10 years ago

ok, made a fix and pushed to master. let me know if this solves the issue

thej4ck commented 10 years ago

ALL GREEN! thanks a lot. issue fixed.

danielhost commented 10 years ago

Hello guys,

We also tried this plugin - looks very usefull if you get too long communication threat in issues - which happens to us quite often.

The error we get is related to different stuff:

  1. wherever you use a private comment within an issue, we get a 500 error message ending up in not displaying thoe whole Issue - we tested it, its a private comment vs. user role related bug.
  2. the error diplaying issue gets the role, that does not have rights to see private comments. Administrator role and role, which has right has dont experiance this problem.

Could you please fix also this? See also screen in attachm error time tab - private comment ent. Thank You a lot - we appreciate. Daniel Host

markedagain commented 10 years ago

hey @danielhost ,

Do you have an error log i can see plz? Private messages have always worked for me and tested once more and all is well. is there a specific role or steps to reproduce the issue ?

danielhost commented 10 years ago

HI @markedagain,

Quick response - Thank You. Let me know, if it helps. If not we will provide you with settings in right for this role.

Thank You,

Daniel

Successful authentication for 'client' from XXXXXXXXXX at Tue Dec 10 15:34:49 UTC 2013 Redirected to http://redmine-dev.fr/issues/1471?tab=history_comments Completed 302 Found in 21ms (ActiveRecord: 2.9ms) Started GET "/issues/1471?tab=history_comments" for XXXXXXXXXX at Tue Dec 10 16:34:49 +0100 2013 Processing by IssuesController#show as HTML Parameters: {"id"=>"1471", "tab"=>"history_comments"} Current user: client (id=9) Rendered issues/_action_menu.html.erb (10.3ms) Rendered attachments/_links.html.erb (11.7ms) Rendered issue_relations/_form.html.erb (4.6ms) Rendered issues/_relations.html.erb (8.1ms) Rendered plugins/redmine_issue_detailed_tabs_time/app/views/issues/_history.html.erb (379.0ms) Rendered issues/show.html.erb within layouts/base (468.8ms) Completed 500 Internal Server Error in 760ms

ActionView::Template::Error (can't convert nil into String): 23: 24:

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__429350092_70077098758100' app/controllers/issues_controller.rb:119:inshow'

app/controllers/issues_controller.rb:116:in `show'

markedagain commented 10 years ago

Are you using a anonymous user ?

markedagain commented 10 years ago

odly i noticed when testing that others can see my private note :( dont think this is the desired action

danielhost commented 10 years ago

No anonymous user. A cassual user as a member of a project (assigned to it) with no rights for displaying private notes. I Think there is a conflict in rendering when private notes is included in the issue and the user doesn not have right to display it.

Dan

markedagain commented 10 years ago

ok, i was able to reproduce the issue, we dont use private notes and i had permissions set to view private notes for all roles, removing this permission also broke the page for me. Will try to get a fix out today or tomorrow. Time to start scratching my head

danielhost commented 10 years ago

Great! We appreciate.

Dan

markedagain commented 10 years ago

ok, i was able to kinda figure out some things. Im not the best in redmines api , so i can get a fix to get the page from not giving out an error, but then for some reason the private notes does show up for the user thats allowed to see it. ill hopefully have more insight after this weekend

markedagain commented 10 years ago

ok , im offically confused, can somebody please explain to me what the private notes behavior is supposed to be? I removed my plugin and noticed that if the role does not have private notes allowed to be viewed that he cant see his own private notes.

I always presumed that regardless of role the private note would be able to be seen by the creator of the note!! Am i incorrect in assuming this?

markedagain commented 10 years ago

ok, after some research and digging, i was incorrect to make this assumption. i fixed the error for private notes now , if the issue persist please open a new ticket as this ticket was originally intended for fix for anonymous users

danielhost commented 10 years ago

@markedagain, thank You! We let you know - we test it.

Dan