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.

Command icon 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

jasdeba created an issue. See original summary.

AstonVictor made their first commit to this issue’s fork.

astonvictor’s picture

Status: Active » Needs review

Created 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.

adamps’s picture

Makes sense to me. Let's get confirmation from the OP.

adamps’s picture

Status: Needs review » Reviewed & tested by the community

No response from OP so please go ahead.

astonvictor’s picture

Status: Reviewed & tested by the community » Fixed

the MR was merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.