[MGNLDATA-170] BaseDataAllCommand.collectNodes in wrong order Created: 22/Mar/13 Updated: 09/Apr/13 Resolved: 29/Mar/13 |
|
| Status: | Closed |
| Project: | Magnolia Data Module (closed) |
| Component/s: | None |
| Affects Version/s: | 1.7 |
| Fix Version/s: | 1.7.5, 2.0 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Zdenek Skodik | Assignee: | Jaroslav Simak |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Template: |
|
||||
| Acceptance criteria: |
Empty
|
||||
| Date of First Response: | |||||
| Description |
|
Imagine you have a hierarchy like: item
subnode
subsubnode
Calling "delete all" on the item let the method populate the nodes in the order reflecting the hierarchy in repository (subnode first, subsubnode second). Hence while looping over this collection, we call #executeNode() (aka node.delete()) for subnode first, which is still ok, but once it's about to #executeNode() upon subsubnode it ends up in InvalidItemStateException (attached) because the subsubnode has been removed already by the previous call. As a workaround one can still do just simple "delete" (hierarchical structure) instead of "delete all". |
| Comments |
| Comment by Jan Haderka [ 29/Mar/13 ] |
|
just reversing the order is not enough. Node paths should be ordered from longest to the shortest. |