Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed to show grouping in drop down only for Ansible Tower type item. #4875

Merged

Conversation

h-kataria
Copy link
Contributor

Trying to use grouped_options_for_select for a drop down that does not have grouping was causing an error in the log and preventing from saving manager_id and template_id fields when adding a Catalog Item type of 'Openshift Template'

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1645676

Without the fix it blows up after Provider is selected

[----] I, [2018-11-05T15:51:17.919049 #5616:7e9e394]  INFO -- : Started POST "/catalog/atomic_form_field_changed/new?manager_id=10000000000024" for ::1 at 2018-11-05 15:51:17 -0500
[----] I, [2018-11-05T15:51:17.957088 #5616:7e9e394]  INFO -- : Processing by CatalogController#atomic_form_field_changed as JS
[----] I, [2018-11-05T15:51:17.957210 #5616:7e9e394]  INFO -- :   Parameters: {"manager_id"=>"10000000000024", "id"=>"new"}
[----] I, [2018-11-05T15:51:18.031618 #5616:7e9e394]  INFO -- :   Rendered /home/hkataria/dev/manageiq-ui-classic/app/views/layouts/_tree.html.haml (2.6ms)
[----] I, [2018-11-05T15:51:18.031850 #5616:7e9e394]  INFO -- :   Rendered /home/hkataria/dev/manageiq-ui-classic/app/views/shared/_tree.html.haml (3.8ms)
[----] I, [2018-11-05T15:51:18.032615 #5616:7e9e394]  INFO -- :   Rendered /home/hkataria/dev/manageiq-ui-classic/app/views/layouts/_ae_tree_select.html.haml (5.3ms)
[----] I, [2018-11-05T15:51:18.036896 #5616:7e9e394]  INFO -- :   Rendered /home/hkataria/dev/manageiq-ui-classic/app/views/catalog/_form_basic_info.html.haml (10.3ms)
[----] F, [2018-11-05T15:51:18.037183 #5616:7e9e394] FATAL -- : Error caught: [ActionView::Template::Error] undefined method `map' for 10000000000233:Integer
Did you mean?  tap
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/actionview-5.0.7/lib/action_view/helpers/form_options_helper.rb:358:in `options_for_select'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/actionview-5.0.7/lib/action_view/helpers/form_options_helper.rb:545:in `block in grouped_options_for_select'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/actionview-5.0.7/lib/action_view/helpers/form_options_helper.rb:535:in `each'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/actionview-5.0.7/lib/action_view/helpers/form_options_helper.rb:535:in `grouped_options_for_select'
/home/hkataria/dev/manageiq-ui-classic/app/views/catalog/_form_basic_info.html.haml:111:in `__home_hkataria_dev_manageiq_ui_classic_app_views_catalog__form_basic_info_html_haml___430276081243073132_69842926874900'

before:
before

after:
after

Trying to use grouped_options_for_select for a drop down that does not have grouping was causing an error in the log and preventing from saving manager_id and template_id fields when adding a Catalog Item type of 'Openshift Template'

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1645676
@miq-bot
Copy link
Member

miq-bot commented Nov 5, 2018

Checked commit h-kataria@5a104e0 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 🍪

@mzazrivec mzazrivec assigned mzazrivec and unassigned dclarizio Nov 6, 2018
@mzazrivec mzazrivec added this to the Sprint 99 Ending Nov 19, 2018 milestone Nov 6, 2018
@mzazrivec mzazrivec merged commit 3c47c43 into ManageIQ:master Nov 6, 2018
simaishi pushed a commit that referenced this pull request Nov 6, 2018
…_down

Fixed to show grouping in drop down only for Ansible Tower type item.

(cherry picked from commit 3c47c43)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1645676
@simaishi
Copy link
Contributor

simaishi commented Nov 6, 2018

Hammer backport details:

$ git log -1
commit 362db9e96e63f8f79ac19d468383d87831d78ddf
Author: Milan Zázrivec <[email protected]>
Date:   Tue Nov 6 09:31:20 2018 +0100

    Merge pull request #4875 from h-kataria/fixed_container_template_drop_down
    
    Fixed to show grouping in drop down only for Ansible Tower type item.
    
    (cherry picked from commit 3c47c434d34da5627bc4fa0f5b15e2d14251e403)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1645676

@h-kataria h-kataria deleted the fixed_container_template_drop_down branch November 6, 2018 14:23
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.

5 participants