[MGNLUI-2325] Saving group in security app fails with InvalidItemStateException Created: 25/Oct/13  Updated: 31/Oct/13  Resolved: 30/Oct/13

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.1.1, 5.2
Fix Version/s: 5.1.2, 5.2

Type: Bug Priority: Critical
Reporter: Tobias Mattsson Assignee: Tobias Mattsson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
caused by MAGNOLIA-5351 Moved or deleted items (pages, compon... Closed
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: 5.1.2

 Description   

When editing a group in security app and saving, whether changes were made or not the operation fails with an InvalidItemStateException.

The action that saves the group, SaveGroupDialogAction, rewrites the entire node so even if you don't do any changes the node is still updated.

Without the 'LastUpdateContentDecorator' it works without problems.
Stacktrace:

Caused by: javax.jcr.InvalidItemStateException: Item cannot be saved because it has been deleted externally: item.save()
	at org.apache.jackrabbit.core.ItemSaveOperation.getTransientStates(ItemSaveOperation.java:323)
	at org.apache.jackrabbit.core.ItemSaveOperation.perform(ItemSaveOperation.java:98)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:329)
	at org.apache.jackrabbit.core.session.SessionSaveOperation.perform(SessionSaveOperation.java:65)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
	at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:361)
	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:812)
	at info.magnolia.jcr.wrapper.DelegateSessionWrapper.save(DelegateSessionWrapper.java:299)
	at info.magnolia.jcr.wrapper.DelegateSessionWrapper.save(DelegateSessionWrapper.java:299)
	at info.magnolia.jcr.wrapper.DelegateSessionWrapper.save(DelegateSessionWrapper.java:299)
	at info.magnolia.audit.MgnlAuditLoggingContentDecoratorSessionWrapper.save(MgnlAuditLoggingContentDecoratorSessionWrapper.java:82)
	at info.magnolia.jcr.wrapper.LastUpdateContentDecorator$LastUpdateSessionWrapper.save(LastUpdateContentDecorator.java:378)
	at info.magnolia.jcr.wrapper.DelegateSessionWrapper.save(DelegateSessionWrapper.java:299)
	at info.magnolia.jcr.wrapper.DelegateSessionWrapper.save(DelegateSessionWrapper.java:299)
	at info.magnolia.audit.MgnlAuditLoggingContentDecoratorSessionWrapper.save(MgnlAuditLoggingContentDecoratorSessionWrapper.java:82)
	at info.magnolia.security.app.dialog.action.SaveGroupDialogAction.execute(SaveGroupDialogAction.java:92)
	... 101 more


 Comments   
Comment by Jan Haderka [ 26/Oct/13 ]

The code in the action does replace mgnl:lastUpdated. In method replacePropertyWithSubnode() it will remove all properties from the subnode except for those that start with jcr: prefix. IMHO the same way it should ignore also all mgnl: properties.

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