Bug 1759784 - "Oops, we're sorry but something went wrong comparison of Array with Array failed" when attempting to edit a smart class parameter.
Summary: "Oops, we're sorry but something went wrong comparison of Array with Array fa...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Puppet
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-09 06:09 UTC by Hao Chang Yu
Modified: 2020-06-04 08:56 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-11 19:19:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Hao Chang Yu 2019-10-09 06:09:50 UTC
Description of problem:
Satellite doesn't convert the matcher to downcase when adding a new matcher field and a matcher in one go from the Web UI.

Steps to Reproduce:
1) In the smart class parameter edit page you add a new "TesT" (title case) field to the Order textbox.
2) You have an existing matcher "fqdn=some.content.host.com".
2) Then click "Add Matcher" to add a new matcher "TesT=true".
3) Click the "submit" button to save
4) Revisit the "edit" page and get "Oops, we're sorry but something went wrong comparison of Array with Array failed"

Reason:
This is because Satellite converted the value in step (1) to down case but leaving the matcher in step (3) as it is. When rendering the page, Satellite can't find the field for the matcher in the list of array.

It found the index of "fqdn" in the array (return an integer) but can't find the index of "TesT" in the array (nil). Comparing nil with 1 raises the following error.

irb(main):002:0> [[nil], [1]].sort_by{|v| v}
ArgumentError: comparison of Array with Array failed


Actual results:
Can't access the edit page

Expected results:
Can access the edit page


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