Manageiq-ui-classic: Nothing in the UI after deleting Alert Profile

Created on 23 Oct 2019  路  9Comments  路  Source: ManageIQ/manageiq-ui-classic

There is an issue in _Alert Profiles_: after deleting the profile, error occurs and nothing happens in the UI, toolbar remains open, no evidence about deleting the profile but the profile was deleted.

Steps to reproduce:

  1. _Control > Explorer > Alert Profiles_
  2. Click on some 'type' of _Alert Profiles_
  3. Create an _Alert Profile_ if there is no one: _Configuration > Add a new ... Alert Profile_
  4. Click on some profile and _Configuration > Delete this Alert Profile_ + click on _OK_

Actual Result:
Nothing happens in the UI + error:

[----] I, [2019-10-23T11:10:58.281599 #12420:2b23edd09030]  INFO -- : Started POST "/miq_policy/x_button/43?pressed=alert_profile_delete" for ::1 at 2019-10-23 11:10:58 +0200
[----] I, [2019-10-23T11:10:58.397896 #12420:2b23edd09030]  INFO -- : Processing by MiqPolicyController#x_button as JS
[----] I, [2019-10-23T11:10:58.398050 #12420:2b23edd09030]  INFO -- :   Parameters: {"pressed"=>"alert_profile_delete", "id"=>"43"}
[----] I, [2019-10-23T11:10:58.518629 #12420:2b23edd09030]  INFO -- :   Rendered /home/hstastna/manageiq/manageiq-ui-classic/app/views/layouts/_flash_msg.html.haml (9.2ms)
[----] I, [2019-10-23T11:10:58.525840 #12420:2b23edd09030]  INFO -- :   Rendered /home/hstastna/manageiq/manageiq-ui-classic/app/views/layouts/_info_msg.html.haml (2.8ms)
[----] I, [2019-10-23T11:10:58.526077 #12420:2b23edd09030]  INFO -- :   Rendered /home/hstastna/manageiq/manageiq-ui-classic/app/views/miq_policy/_alert_profile_list.html.haml (27.3ms)
[----] I, [2019-10-23T11:10:58.543150 #12420:2b23edd09030]  INFO -- :   Rendered /home/hstastna/manageiq/manageiq-ui-classic/app/views/layouts/_x_adv_searchbox.html.haml (13.1ms)
[----] I, [2019-10-23T11:10:58.586091 #12420:2b23edd09030]  INFO -- :   Rendered /home/hstastna/manageiq/manageiq-ui-classic/app/views/layouts/_adv_search_body.html.haml (23.8ms)
[----] I, [2019-10-23T11:10:58.611285 #12420:2b23edd09030]  INFO -- :   Rendered /home/hstastna/manageiq/manageiq-ui-classic/app/views/layouts/_adv_search_footer.html.haml (17.4ms)
[----] I, [2019-10-23T11:10:58.611512 #12420:2b23edd09030]  INFO -- :   Rendered /home/hstastna/manageiq/manageiq-ui-classic/app/views/layouts/_adv_search.html.haml (64.0ms)
[----] I, [2019-10-23T11:10:58.621356 #12420:2b23edd09030]  INFO -- :   Rendered /home/hstastna/manageiq/manageiq-ui-classic/app/views/layouts/_breadcrumbs.html.haml (5.9ms)
[----] F, [2019-10-23T11:10:58.622000 #12420:2b23edd09030] FATAL -- : Error caught: [ActionView::Template::Error] undefined method `name' for #<Array:0x007f3ad41827f0>
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/mixins/breadcrumbs_mixin.rb:156:in `block in build_breadcrumb_from_tree'
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/mixins/breadcrumbs_mixin.rb:156:in `each'
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/mixins/breadcrumbs_mixin.rb:156:in `find'
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/mixins/breadcrumbs_mixin.rb:156:in `build_breadcrumb_from_tree'
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/mixins/breadcrumbs_mixin.rb:90:in `data_for_breadcrumbs'
/home/hstastna/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actionpack-5.1.7/lib/abstract_controller/helpers.rb:68:in `data_for_breadcrumbs'
/home/hstastna/manageiq/manageiq-ui-classic/app/views/layouts/_breadcrumbs.html.haml:2:in `__home_hstastna_manageiq_manageiq_ui_classic_app_views_layouts__breadcrumbs_html_haml__949636016658071506_69945321802300'

alert_profile_delete

_Note:_
After refreshing the page "Last selected Alert Profile no longer exists" flash message occurs so it seems that the profile was deleted successfully:
last_selected

Most helpful comment

@hstastna I will investigate.

All 9 comments

@rvsia The error seems to be related to breadcrumbs.

@hstastna I will investigate.

Please, verify if this also affects Ivanchuk.

@martinpovolny I've tested this on 5.11.0.27.20191001204742_d9cf38b and it works there.
@rvsia Any update about this issue?

@hstastna I found what is wrong here. @trees https://github.com/ManageIQ/manageiq-ui-classic/blob/e12b34634a1707967d9a1a60cd91fed57b4ef935/app/controllers/miq_policy_controller.rb#L447 is a hash with trees names as keys... everywhere else @trees is an array.

I can make some fallback condition in Breadcrumb mixin to ignore hashes / or going over keys when it's a hash... but I think it makes more sense to refactor the code I shown above to use an array instead of a hash. What do you think @martinpovolny and who could be assigned to do it?

Edit: Also Ivanchuk uses different breadcrumbs as any of the PRs was not backported.. but after they will be backported, the issue will be probably there too.

@martinpovolny

@hstastna : do my changes fix your issue?

@martinpovolny Thank you, let me check. If I find that your PR fixes the issue, I will close the issue.

Was this page helpful?
0 / 5 - 0 ratings