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

Error when clicking on an occurrence item to see more detail #97

Open
hjeong11 opened this issue Nov 25, 2013 · 2 comments
Open

Error when clicking on an occurrence item to see more detail #97

hjeong11 opened this issue Nov 25, 2013 · 2 comments

Comments

@hjeong11
Copy link

To replicate:
Click on a bug, then "occurrences" tab. Then click on one of the occurrence items. See below for the error trace.

ActionView::Template::Error (bad component(expected fragment component): #/):
     98:       def other_occurrence_info
     99:         if @occurrence.web?
    100:           h5 "Request"
    101:           pre "#{@occurrence.request_method} #{@occurrence.url.to_s}", class: 'scrollable'
    102:         end
    103:       end
    104:
  app/models/occurrence.rb:510:in `url'
  app/views/occurrences/show.html.rb:101:in `other_occurrence_info'
  app/views/occurrences/show.html.rb:53:in `block in body_content'
  app/views/layouts/application.html.rb:49:in `block (4 levels) in full_width_section'
  app/views/layouts/application.html.rb:49:in `block (3 levels) in full_width_section'
  app/views/layouts/application.html.rb:49:in `block (2 levels) in full_width_section'
  app/views/layouts/application.html.rb:48:in `block in full_width_section'
  app/views/layouts/application.html.rb:47:in `full_width_section'
  app/views/occurrences/show.html.rb:34:in `body_content'
  app/views/layouts/application.html.rb:161:in `block in body_portion'
  app/views/layouts/application.html.rb:148:in `body_portion'
  app/views/layouts/application.html.rb:27:in `block in content'
  app/views/layouts/application.html.rb:25:in `content'
  app/views/occurrences/show.html.rb:1:in `_app_views_occurrences_show_html_rb__1648341601887724721_70129514060960'
  app/controllers/occurrences_controller.rb:242:in `show'

Removing "fragments" in models/occurrence.rb (line 510) seems to fix it.
ie) change

URI.scheme_list[schema.upcase].build(host: host, port: port, path: path, query: query, fragment: fragment)

to

URI.scheme_list[schema.upcase].build(host: host, port: port, path: path, query: query)
@RISCfuture
Copy link
Contributor

OK, I don't know why the Ruby URI class seems to believe that / is an invalid fragment name, but I probably need a more liberal URL parser.

@lsegal
Copy link
Contributor

lsegal commented Dec 7, 2013

The invalid fragment is not /, but rather, #/, which does indeed look invalid. The problem seems to be that '#' was leaked into the fragment somehow, not that the URI parser is misbehaving.

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

3 participants