[MAGNOLIA-3883] Same-Name Sibling possible when moving page in admincentral Created: 14/Nov/11  Updated: 23/Jan/12  Resolved: 16/Nov/11

Status: Closed
Project: Magnolia
Component/s: admininterface
Affects Version/s: 4.4
Fix Version/s: 4.4.6

Type: Bug Priority: Major
Reporter: Nickolaus Wing Assignee: Ondrej Chytil
Resolution: Fixed Votes: 0
Labels: admincentral
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File AdminTreeMVCHandler.java.patch    
Issue Links:
causality
is causing MGNLDMS-224 Move/Copy documets to root fails on e... Closed
Template:
Patch included:
Yes
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   

Steps to reproduce:

1) Create two pages, "parent1" and "parent2"
2) Create two subpages in each, "subpage1" and "subpage2"
3) Move "parent2/subpage2" BETWEEN "parent1/subpage1" and "parent1/subpage2"

"parent1" now has two pages named "subpage2", which causes various other problems.

I traced this down to a queer bit of logic in magnolia-module-admininterface/.../AdminTreeMVCHandler.java.

In the pasteNode() method, in the section pertaining to PASTETYPE_ABOVE and PASTETYPE_BELOW, it decides to do an end run around the copyMoveNode() method ONLY when moving, and ONLY when the pastetype is above or below.

For instance, if you were to replace step 3 above with:
3) Move "parent2/subpage2" onto "parent1"

In that case, copyMoveNode() would be used and everything would work fine.

From browsing the SVN changelog, this behavior has apparently been in place since at least 2006.

I've included a patch file (against trunk) with the recommended fix.



 Comments   
Comment by Ondrej Chytil [ 16/Nov/11 ]

Thanks for patch Nickolaus.

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