Skip to content

Conversation

asirvadAbrahamVarghese
Copy link
Contributor

@asirvadAbrahamVarghese asirvadAbrahamVarghese commented Aug 21, 2025

PR fixes the issue mentioned in #9526

Before:

image

After:

image

Fix Analysis:

The problem was diagnosed and resolved with AI assistance, after slight tweaks

if automate_tree_needed?
          page.replace("basic_info_div", :partial => "form_basic_info")

was the culprit here that duplicates "Basic Information" heading when "Display in Catalog" checkbox's onChange gets fired.
Restructuring the code to use an if-elsif chain withpage.replace("basic_info_div"...) condition moved to the last ensures it's not executed when params[:display] is true which prevents the duplicate headings issue.

I was just verifying through these catalog types (others seem to be disabled, possibly due to missing data):
Amazon
Ansible Automation Platform
Ansible Playbook
Azure
Generic
Google
OpenShift Template
OpenStack
Orchestration
Red Hat Virtualization
Terraform Template
VMware
VMware Content Library OVF Template

and they are either starting with generic(first condition) or params[:display] is true
so I was thinking whether we should completely remove the block for page.replace("basic_info_div"...)

@miq-bot assign @Fryguy
@miq-bot add-reviewer @agrare
@miq-bot add-label bug

@asirvadAbrahamVarghese asirvadAbrahamVarghese requested a review from a team as a code owner August 21, 2025 09:14
@miq-bot miq-bot requested a review from agrare August 21, 2025 09:16
@GilbertCherrie GilbertCherrie self-assigned this Aug 21, 2025
@Fryguy
Copy link
Member

Fryguy commented Aug 25, 2025

Do you know what params[:display] means? I've never understood that one.

@asirvadAbrahamVarghese
Copy link
Contributor Author

Do you know what params[:display] means? I've never understood that one.

The params[:display] parameter appears to be a boolean-like flag to me("1" for true) that helps in conditional rendering I believe.
For most service category types, params object would have display as 1 #<ActionController::Parameters {"display"=>"1", "form_field_changed"=>"true",...., so that params[:display] is mostly truthy

@Fryguy Fryguy merged commit 2f575ae into ManageIQ:master Aug 29, 2025
18 checks passed
@Fryguy
Copy link
Member

Fryguy commented Sep 3, 2025

Backported to spassky in commit b48e0c1.

commit b48e0c19822dc302cb7bab2a44fe622bbb7ca714
Author: Jason Frey <[email protected]>
Date:   Fri Aug 29 15:27:39 2025 -0400

    Merge pull request #9568 from asirvadAbrahamVarghese/fix-duplicate-basic-info-title
    
    Resolve duplicate Basic Info heading in create catalog item form
    
    (cherry picked from commit 2f575aecf1bca6b9edb1d2e796547474f9e2fec5)

Fryguy added a commit that referenced this pull request Sep 3, 2025
…sic-info-title

Resolve duplicate Basic Info heading in create catalog item form

(cherry picked from commit 2f575ae)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants