[MGNLUI-3830] Returning to root selection breaks Resource Files app Created: 04/Mar/16  Updated: 15/Apr/16  Resolved: 14/Apr/16

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.4.5
Fix Version/s: 5.4.6

Type: Bug Priority: Major
Reporter: Mikaël Geljić Assignee: Mikaël Geljić
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 6d
Original Estimate: 5d

Attachments: PNG File itemClick-resources-app-failure.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Saigon 39
Story Points: 5

 Description   
  1. Open Resource Files app
  2. Select 1st level resource (file or dir)
  3. Hit the keyboard left arrow to return to default (root) selection
  4. Click any resource

Pulse says:

Error: Invocation of method itemClick in info.magnolia.ui.workbench.list.ListViewImpl$3 failed. caused by NullPointerException

Logs say:

2016-03-04 13:40:06,805 WARN  info.magnolia.event.SimpleEventBus                : Exception caught when dispatching a class info.magnolia.ui.workbench.event.SelectionChangedEvent event with class info.magnolia.ui.workbench.WorkbenchStatusBarPresenter$1 eventHandler.
java.lang.NullPointerException
	at info.magnolia.ui.workbench.WorkbenchStatusBarPresenter.setSelectedItems(WorkbenchStatusBarPresenter.java:103)
	at info.magnolia.ui.workbench.WorkbenchStatusBarPresenter$1.onSelectionChanged(WorkbenchStatusBarPresenter.java:80)
	at info.magnolia.ui.workbench.event.SelectionChangedEvent.dispatch(SelectionChangedEvent.java:75)
	at info.magnolia.ui.workbench.event.SelectionChangedEvent.dispatch(SelectionChangedEvent.java:45)
	at info.magnolia.event.SimpleEventBus.fireEvent(SimpleEventBus.java:78)
	at info.magnolia.ui.workbench.AbstractContentPresenterBase.onItemSelection(AbstractContentPresenterBase.java:144)
	at info.magnolia.ui.workbench.list.ListViewImpl$2.valueChange(ListViewImpl.java:131)
	...
	at com.vaadin.ui.AbstractField.fireValueChange(AbstractField.java:1137)
	...
        at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:678)
	at com.vaadin.ui.TreeTable.focusParent(TreeTable.java:462)
	at com.vaadin.ui.TreeTable.changeVariables(TreeTable.java:441)
	at info.magnolia.ui.vaadin.grid.MagnoliaTreeTable.changeVariables(MagnoliaTreeTable.java:86)


 Comments   
Comment by Ilgun Ilgun [ 24/Mar/16 ]

I moved the ticket to UI because the necessary and more generic fix can/should be done in UI.

Comment by Mikaël Geljić [ 25/Mar/16 ]

Check out branch bugfix/MGNLUI-3830-returning-to-root-selection-breaks on my fork; I did the following:

  • Make WorkbenchStatusBarPresenter and ListViewImpl handle null itemIds properly
  • Remove null itemId from table selection; let presenter + contentConnector decide what default itemId to use then
  • Fix HierarchicalJcrContainer#getParent: container roots (in that case rootPath level+1 nodes) must return null

Would be nice to wrap this up with a couple unit tests where applicable (obviously I stopped half-way while doing that for WorkbenchStatusBarPresenterTest)

Comment by Aleksandr Pchelintcev [ 04/Apr/16 ]

mgeljic the branch looks good to me (also quickly tested the fix) - I propose that you create a PR for it and somebody contributes the necessary tests asap.

Generated at Mon Feb 12 09:10:30 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.