Problem/Motivation
Duplicating a root node puts the copy first in the root, not next to the node. ApiActionsController::paste() calls attachToRoot(0, ...) and ignores the slot_position the contextual menu sends. The slot path uses it. Left open by #3627000: Duplicate from the contextual menu puts a root component inside its own first slot.
This is about where the copy lands when there is room. #3627023: Duplicate is offered where it can only fail: a full root or slot is about offering Duplicate where there is none.
Steps to reproduce
- Drop three components at the root.
- Right-click the last one and choose Duplicate.
- The copy is first, not fourth.
Proposed resolution
- Pass
slot_positiontoattachToRoot(), as the slot path does. - Drop the
@todoabove it, about the bug #3627000: Duplicate from the contextual menu puts a root component inside its own first slot fixed. - Kernel test: a paste at a root position lands there.
User interface changes
A duplicate at the root lands next to its original.
API changes
None.
Data model changes
None.
Issue fork display_builder-3627104
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mogtofu33 commentedComment #4
mogtofu33 commented