Problem/Motivation

Inserting a pattern preset that carries island settings, styles or tokens for example, creates one revision for the attach, then one more per island. Undo removes the settings one by one before it removes the node.

ApiController::attachPresetToRoot() and attachPresetToSlot() call setThirdPartySettings() once per island after attaching, and each call saves a revision. Reproduced in a kernel test: a preset with styles and tokens makes 3 revisions.

Proposed resolution

Pass the settings to attachToRoot() and attachToSlot(), which already take them for paste. Kernel test counting the revisions.

Found while reviewing #3624396: Plan: Harden InstanceInterface, IslandInterface and DisplayBuildableInterface as public API before RC1.

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

Assigned: Unassigned » mogtofu33
Status: Active » Needs work

Also fixed in the same methods: a preset inserted into a slot dispatched onAttachToRoot with no parent. It now dispatches onAttachToSlot with the parent, as paste into a slot does, so the View panels replace the parent node instead of reloading.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » 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 3fb9d588 on 1.0.x
    fix: #3626660 Inserting a preset is one undo step
    
    by: mogtofu33