Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-5999

Fail to render profile comparison page when parameter id1 is declared as an array

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1
    • Component/s: Quality Profile
    • Labels:
      None

      Description

      For instance when using this link : http://localhost:9000/profiles/compare?id1[]=&id2=, the page will fail with a 500 error.

      Here's the server's log :

      2014.12.31 12:43:32 ERROR web[o.s.s.ui.JRubyFacade]  Fail to render: http://localhost:9000/profiles/compare?id1[]=&id2=
      undefined method `to_i' for [""]:Array
      	On line #5 of app/views/profiles/compare.html.erb
      
          2: <form method="GET" class="marginbottom10">
          3:   <select name="id1" class="small">
          4:     <option value=""></option>
          5:     <%= options_for_profiles(@profiles, params[:id1].to_i) %>
          6:   </select>
          7:
          8:   <select name="id2" class="small">
      
          app/views/profiles/compare.html.erb:5
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julien.lancelot Julien Lancelot
                Reporter:
                julien.lancelot Julien Lancelot
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: