Bug 1494435 - undefined method `split' for 4:Fixnum [miq_request/show] raised when displaying the details of a request
Summary: undefined method `split' for 4:Fixnum [miq_request/show] raised when displayi...
Keywords:
Status: CLOSED DUPLICATE of bug 1470068
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.8.0
Hardware: All
OS: All
high
medium
Target Milestone: GA
: cfme-future
Assignee: lgalis
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-22 09:08 UTC by Felix Dewaleyne
Modified: 2021-06-10 13:06 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-25 17:09:28 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.