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.
Issue fork display_builder-3626660
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 commentedAlso fixed in the same methods: a preset inserted into a slot dispatched
onAttachToRootwith no parent. It now dispatchesonAttachToSlotwith the parent, as paste into a slot does, so the View panels replace the parent node instead of reloading.Comment #4
mogtofu33 commented