Implement `::onDependencyRemoval()` for `Pattern` and `PageRegion` config entities: when a module providing a field type is uninstalled, replace it with the default StaticPropSource

Created on 14 May 2025, 1 day ago

Overview

See \Drupal\Tests\experience_builder\Functional\ContentTemplateDependencyTest::testRemoveFieldTypeProviderModule().

The same automatic updating is needed for Pattern and PageRegion config entities (aka all other XB config entity types that implement ComponentTreeEntityInterface).

Proposed resolution

  1. Implement ::onDependencyRemoval() for Pattern and PageRegion
  2. … and use the ComponentTreeItem::updatePropSourcesOnDependencyRemoval() to achieve that, see \Drupal\experience_builder\Entity\ContentTemplate::onDependencyRemoval() for how to do that
  3. Explicit test coverage, inspired by ContentTemplateDependencyTest::testRemoveFieldTypeProviderModule(), but as a kernel test rather than a functional test. Add \Drupal\Tests\experience_builder\Kernel\Config\PatternTest and …\PageRegionTest.
  4. Finally: refactor all 3 ::onDependencyRemoval() implementations to move that logic into a trait to share the logic

User interface changes

When uninstalling a module providing a field type in use by Patterns or PageRegions, those Patterns or PageRegions would no longer be listed to get uninstalled! 👍 😅

Feature request
Status

Active

Version

0.0

Component

Config management

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024