[MGNLUI-2990] Not able to perform multi delete on folders in Security app Created: 11/Jun/14  Updated: 26/Feb/15  Resolved: 16/Jun/14

Status: Closed
Project: Magnolia UI
Component/s: security app
Affects Version/s: 5.2.5, 5.3
Fix Version/s: 5.3

Type: Bug Priority: Major
Reporter: Eric Hechinger Assignee: Eric Hechinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2014-06-11 at 09.09.58.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:

 Description   

Go to security app
Go to roles or groups sub app

  • create two root folders
  • select them
  • click delete folder

One folder will be deleted, the second not and an error message is displayed.

Deletion works fine for a single element (folder or role) but not for multiple.



 Comments   
Comment by Christopher Zimmermann [ 11/Jun/14 ]

Problem appears to be in DeleteEmptyFolderAction#onPreExecute.

This methods purpose is to check if a folder has contents, and if it does to cancel the delete and display an error message. onPreExecute gets called on each item - (See AbstractMultiItemAction) - in turn as it is processed. But this method tries to scan ALL of the items each time - which is incorrect. It should only check the contents of the current item being processed.

So:
final String workspaceName = items.get(0).getJcrItem().getSession().getWorkspace().getName();
Causes a null pointer exception when the method is run the second time - because the first item "get(0)" has already been deleted.

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