Problem/Motivation
Layout Builder overrides require that the entity has a canonical route available, which is usually tied to the "default" view mode.
Layout Builder defaults have no such requirement, as they are usable by any view mode.
layout_builder_entity_type_alter()
provides a layout-builder
link template only for entity types that:
- are fieldable
- have a view builder
- have a canonical link template
This logic is then used throughout the module to determine which entities get the Layout Builder UI provided.
However, the logic should instead be split, and clarified.
Overrides should only work for entity types that:
- are fieldable
- have a view builder
- have a canonical link template
Defaults should work for entity types that:
- are fieldable
- have a view builder
- have a Field UI base route
Proposed resolution
Instead of having this logic within this hook and referencing it from each plugin, keep the logic stored within each plugin.
The logic will continue to need to be copied into LayoutBuilderLocalTaskDeriver, as that still remains a workaround for #2936655: Layout Builder should use the toolbar modes system once it exists.
Remaining tasks
N/A
User interface changes
N/A
API changes
The "layout-builder" link template is removed.
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#4 | 2942590-link_template-4-PASS.patch | 14.92 KB | tim.plunkett |
#4 | 2942590-link_template-4-FAIL.patch | 8.23 KB | tim.plunkett |
#2 | 2942590-link_template-2.patch | 14.92 KB | tim.plunkett |
Comments
Comment #2
tim.plunkettComment #3
EclipseGc CreditAttribution: EclipseGc at Acquia commentedThis looks good, and the tests look great. Glad to see us nail this down.
Eclipse
Comment #4
tim.plunkettI forgot to post a tests-only version, doing so now.
Comment #5
tim.plunkettComment #7
EclipseGc CreditAttribution: EclipseGc at Acquia commentedComment #8
tim.plunkettBumping to major as this is a contributed project blocker and should be backported to 8.5.x ASAP
Comment #11
larowlanfixed on commit
Committed as c57b190 and pushed to 8.6.x.
C/P'd as 17e4881 and pushed to 8.5.x.
Comment #12
tim.plunkett