Problem/Motivation

PatternPreset::getGroup() resolves the group from the root source when the preset has none, then calls $this->save(). A preset whose source has no group is saved on every read. PresetLibraryPanel reads it twice per preset and PatternPresetListBuilder once per row, so every render of the preset library or the preset list writes config.

Proposed resolution

Resolve the group without saving, and store it from preSave(), skipped during a config sync, so a preset saved again keeps it. Kernel test counting saves with the EntitySaveCounter of display_builder_test.

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 committed 74a21cb7 on 1.0.x
    fix: #3626661 Reading the group of a pattern preset no longer saves it...
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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.