Bug 1424843

Summary: Removing all folders from an accordion in Report Menu makes the Reports page display error
Product: Red Hat CloudForms Management Engine Reporter: myoder
Component: UI - OPSAssignee: Zita Nemeckova <znemecko>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Stefanisin <jistefan>
Severity: medium Docs Contact:
Priority: high    
Version: 5.6.0CC: abellott, cpelland, dclarizi, hkataria, jhardy, mpovolny, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: report
Fixed In Version: 5.8.0.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1432093 (view as bug list) Environment:
Last Closed: 2017-06-12 16:52:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1432093    

Description myoder 2017-02-19 19:22:26 UTC
Description of problem: 

When editing the Report Menu, if you remove all of the folders under an accordion, the reports page will not display for that user.


Version-Release number of selected component (if applicable):


How reproducible:
Alwyas

Steps to Reproduce:
1. Navigate to Edit Report Menus
2. Select a group to edit and remove the Folder "Virtual Machines" from the accordion "Migration Readiness" and save.
3. The accordion "Migration Readiness" is now empty.
4. Login as a user from the group that was used to edit.
5. Navigate to Cloud Intel => Reports
6. "Unexpected error encountered" is displayed on the page.

Actual results:


Expected results:


Additional info:

Comment 2 Harpreet Kataria 2017-02-20 21:47:46 UTC
Zita,

Can you take a look at this, looks like it is blowing up while building reports tree when second level folder has been deleted. See error stack below:

[----] F, [2017-02-20T16:40:11.895109 #25112:29efc94] FATAL -- : Error caught: [NoMethodError] undefined method `each_with_index' for "":String
Did you mean?  each_line
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder_report_reports.rb:49:in `x_get_tree_custom_kids'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_kids.rb:35:in `x_get_tree_kids'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder.rb:242:in `x_get_tree_objects'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder.rb:266:in `x_build_node'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder.rb:287:in `x_build_node_tree'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder.rb:212:in `block in x_build_tree'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder.rb:207:in `map'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder.rb:207:in `x_build_tree'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder.rb:142:in `build_tree'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder.rb:26:in `initialize'
/home/hkataria/dev/manageiq-ui-classic/app/presenters/tree_builder_report_reports.rb:7:in `initialize'
/home/hkataria/dev/manageiq-ui-classic/app/controllers/application_controller/feature.rb:28:in `new'
/home/hkataria/dev/manageiq-ui-classic/app/controllers/application_controller/feature.rb:28:in `build_tree'
/home/hkataria/dev/manageiq-ui-classic/app/controllers/application_controller.rb:2409:in `block in build_accordions_and_trees'
/home/hkataria/dev/manageiq-ui-classic/app/controllers/application_controller.rb:2409:in `collect'
/home/hkataria/dev/manageiq-ui-classic/app/controllers/application_controller.rb:2409:in `build_accordions_and_trees'
/home/hkataria/dev/manageiq-ui-classic/app/controllers/report_controller.rb:133:in `explorer' 

Let me know if you have questions or need help recreating.

Thanks,
~Harpreet