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

Fix adding a new Service Catalog Item for Vmware Catalog Item Type #4750

Conversation

hstastna
Copy link

@hstastna hstastna commented Oct 9, 2018

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

What:
There was a problem while adding a new Service Catalog Item for Vmware Catalog Item Type: nothing happened in the UI, no change, Catalog Item was not saved; no error message; error in log occurred.

Steps to reproduce:

  1. Go to Services > Catalogs > Catalog Items accordion
  2. Configuration > Add a New Catalog Item
  3. Choose Catalog Item Type: VMware
  4. Fill in the Name, choose some Dialog (yes, you need to create some Dialog before these steps if there are no ones), no matter if you choose some Catalog or not
  5. Click on Add button
    => error:
[1] pry(#<ManageIQ::Providers::Vmware::InfraManager::ProvisionWorkflow>)> 
[----] F, [2018-10-09T16:17:08.243588 #18459:2b22530a6b6c] FATAL -- : Error caught: [NoMethodError] undefined method `errors' for false:FalseClass
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/catalog_controller.rb:940:in `atomic_req_submit'
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/catalog_controller.rb:94:in `atomic_st_edit'
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/catalog_controller.rb:74:in `servicetemplate_edit'

Note:
You can check Display in Catalog checkbox, while creating a Catalog Item, but it does not matter. It does not have any influence (comparing to what the BZ says).


Before: (nothing happens in the ui, no flash message, error in log)
cat_item_before

After: (another required info was not filled in so flash messages occur)
cat_item-after


Note2: (see the commit 56e0291)
Since request can be boolean or an object, I added request && to the appropriate line.
See this:

[1] pry(#<CatalogController>)> request&.errors.present?
NoMethodError: undefined method `errors' for false:FalseClass
from (pry):4:in `atomic_req_submit'

vs.

[2] pry(#<CatalogController>)> 
[3] pry(#<CatalogController>)> request && request&.errors.present?
=> false

https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_request_workflow.rb#L84 returns false

@hstastna
Copy link
Author

hstastna commented Oct 9, 2018

@miq-bot add_label bug, hammer/yes, blocker

@hstastna hstastna force-pushed the Service_Catalogs_Cannot_add_new_Service_Catalog_Item2 branch from 095869a to 56e0291 Compare October 10, 2018 10:58
@hstastna hstastna changed the title [WIP] Fix adding a new Service Catalog Item for Vmware Catalog Item Type Fix adding a new Service Catalog Item for Vmware Catalog Item Type Oct 10, 2018
@hstastna
Copy link
Author

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Oct 10, 2018
@h-kataria
Copy link
Contributor

verified fix. Looks good

@h-kataria h-kataria self-assigned this Oct 10, 2018
@h-kataria h-kataria added this to the Sprint 97 Ending Oct 22, 2018 milestone Oct 10, 2018
@h-kataria h-kataria merged commit d34a138 into ManageIQ:master Oct 10, 2018
simaishi pushed a commit that referenced this pull request Oct 11, 2018
…w_Service_Catalog_Item2

Fix adding a new Service Catalog Item for Vmware Catalog Item Type

(cherry picked from commit d34a138)

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

Hammer backport details:

$ git log -1
commit 470132be8367ddc6f06bab87f49cc6612c0f368a
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Wed Oct 10 11:39:22 2018 -0400

    Merge pull request #4750 from hstastna/Service_Catalogs_Cannot_add_new_Service_Catalog_Item2
    
    Fix adding a new Service Catalog Item for Vmware Catalog Item Type
    
    (cherry picked from commit d34a138465b54f66efb97dd752313d95544e09a1)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1630385

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