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

  1. Drop three components at the root.
  2. Right-click the last one and choose Duplicate.
  3. The copy is first, not fourth.

Proposed resolution

User interface changes

A duplicate at the root lands next to its original.

API changes

None.

Data model changes

None.

Command icon 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

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mogtofu33 committed daaf2db8 on 1.0.x
    fix: #3627104 Duplicate and paste at the root land at the position they...