Problem/Motivation
Update hook manage_display_update_9301() updates the entity link setting of the title field.
For some reason layout builder identified this as a new field instead of an updated field.
The result was that an extra title field was added to the layouts that were still based on a field-based view mode.
Steps to reproduce
* Have a view mode layout with a title field. The default view mode is still field-based and also contains a title field.
* Update this module and run the update hooks (manage_display_update_9301())
* Notice that there is an extra title field added to the layout.
Proposed resolution
I didn't dig to deep in this issue, so Layout builder might also contain some opinionated code.
I added an extra check to the update hook that skips the 'link_to_entity' change if the display uses layout builder.
Afterwards, I manually did a find and replace on my view mode configs to apply the 'link_to_entity' change.
| Comment | File | Size | Author |
|---|
Issue fork manage_display-3381626
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
Comment #4
astonvictor commentedCreated a new MR.
I was able to reproduce it but updating all layout builders manually is the wrong way.
I fixed it by moving the saving of the display outside the component loop.
please, check if ti works for you.
Comment #5
adamps commentedMakes sense to me. Let's get confirmation from the OP.
Comment #6
adamps commentedNo response from OP so please go ahead.
Comment #7
astonvictor commentedthe MR was merged.