Stop auto-generating entity-ce-display config

Created on 3 May 2024, about 1 month ago
Updated 27 May 2024, 20 days ago

Problem

The module currently has some code and service for auto-generating entity-ce-displays as needed. It turns out, this is not easy get right, since there are no hooks for entity types.

Proposed Solution

Follow the known to work-well solution of core entity-view-displays. The displays are loaded via EntityViewDisplay::collectRenderDisplays() which takes care of auto-creating displays when no display is exiting. That way, no auto-creation logic is needed.
This solution, would simplify things quite a bit and would help us to get rid of the service for intializing the config. But it creates one additional problem for EntityCeDisplays:

Backwards compatibility. Currently NO-display-config means BC is active and processing simply applies. With the solution, this would not work any more, since the config would be auto-created in this case.

For solving backwards compatibility, we could add a hidden config-setting in EntityDisplayConfig, what turns on "auto-processing" for the complete entity view mode. When turned on, we can show this in the UI, similar like we show it when Layout-Builder takes over.

(Side note: EntityDisplayRepository is for the display-modes e.g. the view-modes + form-modes -- which are not the entity-view-displays.)

Original report

Update: The behavior seems correct, since the test-module has entity-view-displays that do not render any fields.

Problem/Motivation

When a module like `custom_elements_test_paragraphs` with default config is installed, the generated CE-displays are invalid and contain empty components/content array.

Steps to reproduce

See current work-a-round in \Drupal\custom_elements\CustomElementsConfigGenerator::configExists and \Drupal\Tests\custom_elements\Functional\CustomElementsRenderMarkupTest::setUp - When removing the workarounds there, tests fail because the config is generated empty during install

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇦🇹Austria fago Vienna

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024