Problem/Motivation

#3562750: Field, Theme or module uninstalled prunes a page layout and disables it, but only in the default config.
The instance keeps the removed nodes, so publish writes them back.
Rendering them then throws ComponentNotFoundException.
Language overrides suffer too: core filters them by array position on save, so pruning a root node wipes the translations of its siblings.

Steps to reproduce

  1. Build a page layout with a component of a theme and a text source.
  2. Translate the text in German and publish.
  3. Set another default theme and uninstall the first one.
  4. Read the German override: the translation is gone.
  5. Publish the instance, enable the layout and open a page: it fails.

Proposed resolution

Prune every translation of the instance after the save, with the dependencies kept by onDependencyRemoval(), which cannot write because of the dry run.
The next publish then rewrites the overrides from the instance.

Remaining tasks

  • A layout holding an unknown source plugin aborts a theme uninstall: PageLayout::calculateDependencies() is unguarded.
  • SourceTree::normalize() only unsets the slots from getSlotDefinitions(), so a region missing from the default theme gets its whole root pruned.
  • The provider of a source plugin is not a dependency, so a node using a removed module's source is not pruned.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture