Bug 1494435

Summary: undefined method `split' for 4:Fixnum [miq_request/show] raised when displaying the details of a request
Product: Red Hat CloudForms Management Engine Reporter: Felix Dewaleyne <fdewaley>
Component: UI - OPSAssignee: lgalis
Status: CLOSED DUPLICATE QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: high    
Version: 5.8.0CC: fdewaley, hkataria, jhardy, mpovolny, obarenbo
Target Milestone: GA   
Target Release: cfme-future   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-25 17:09:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:

Description Felix Dewaleyne 2017-09-22 09:08:07 UTC
Description of problem:
undefined method `split' for 4:Fixnum [miq_request/show] raised when displaying the details of a request

Version-Release number of selected component (if applicable):
5.8.1.5

How reproducible:
all the time

Steps to Reproduce:
1.provision a service with a dynamic dialog that includes an integer value
2.display the results of the request
3.

Actual results:
undefined method `split' for 4:Fixnum [miq_request/show]

Expected results:
able to display the values

Additional info:
this seems already fixed in upstream (https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/helpers/application_helper/dialogs.rb) : on the appliance we have no checks :

  def dialog_dropdown_selected_value(field)
    if !field.values || field.values.empty?
      return field.value
    end

    values = field.values.to_h
    result = field.value.split(',').collect do |val|
      if values.include?(val)
        values.to_h[val]
      else
        val
      end
    end
    result.join(',')
  end

On the upstream version, there is a check

 def dialog_dropdown_selected_value(field)
    if !field.values || field.values.empty?
      return field.value
    end
    if field.value.kind_of?(String) && field.value.include?(',')
      values = field.values.map do |a|
        a.map!(&:to_s)
      end.to_h
      result = field.value.split(',').collect do |val|
        values.include?(val) ? values[val] : val
      end
      result.join(',')
    else
      values = field.values.to_h
      values.include?(field.value) ? values[field.value] : field.value
    end
  end