[MAGNOLIA-5337] MarkNodeAsDeletedCommand mark only child items as deleted Created: 25/Sep/13  Updated: 17/Dec/13  Resolved: 12/Nov/13

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2

Type: Bug Priority: Major
Reporter: Milan Divilek Assignee: Peili Liang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
is causing MAGNOLIA-5414 Error is shown when deleting contact ... Closed
is causing MAGNOLIA-5492 RestorePreviousVersionAction should r... Closed
relation
is related to MAGNOLIA-5558 MarkNodeAsDeletedCommand is not flexi... 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.2-rc1, 5.1.1, 5.2-beta1

 Description   

MarkNodeAsDeletedCommand mark only child items as deleted but not folders and their child nodes.

Reproduce in contact app:
Create structure as

  • rootFolder [type mgnl:folder]
    • subFolder [type mgnl:folder]
      • contactInSubFolder [type mgnl:contact]
    • contactInRootFolder [type mgnl:contact]

Then select rootFolder and use Delete folder action. Confirm warning about "the node and its sub nodes will be marked for deletion".

RootFolder and contactInRootFolder will be correctly marked as deleted, but subFolder and contactInSubFolder not.



 Comments   
Comment by Eric Hechinger [ 23/Oct/13 ]

This fix is causing MAGNOLIA-5414.
Had to rollback the commit.

Comment by Christopher Zimmermann [ 24/Oct/13 ]

From Jan:"only contact should be versionable, but it seems that somehow version manager is trying to version photo of the contact on it's own as well". I think that versioning the image should at least be considered - it would be nice to version the image if possible. Consider assets especially.

Comment by Eric Hechinger [ 24/Oct/13 ]

Another hint: Deletion of a folder use the same command 'MarkNodeAsDeletedCommand' as the deletion of an Item (contact). This command create version's, but the mgnl:folder nodeType is not configured to support versions.
In addition the Command was not designed to support recursivity like the version commands.

Suggestion (to be discuss with architects)

  • Amend folder nodeType definition (add a <supertype>mgnl:versionable</supertype>)
  • Add a parameter to the MarkNodeAsDeletedCommand in order to better handle recursivity.
Comment by Jan Haderka [ 08/Nov/13 ]

Amend folder nodeType definition (add a <supertype>mgnl:versionable</supertype>)

make sure to not mistake mgnl:versionable with mix:versionable
mgnl:versionable could be added tho not sure for what we want it. It still should not have version browsing restore and other features. The only time we need versioning capability for folder is when marking it as deleted and then special template is (was?) used allow you to undelete … which of course could/should be action in action bar instead now (but that's question for Andreas)

Add a parameter to the MarkNodeAsDeletedCommand in order to better handle recursively.

What parameter? I know you mentioned above that command was not designed to handle recursively, but i still don't understand why this should be switchable? When you delete something, everything underneath has to be marked as deleted as well because it can't be available anymore to any other part of Magnolia (templates, navigation, links, etc) so it has to be always recursive. Why the parameter then?

Comment by Jaroslav Simak [ 17/Dec/13 ]

Reverted as part of MAGNOLIA-5558 fix.

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