Field values lost when serializing an entity with a viewsreference field

Created on 18 August 2022, over 2 years ago
Updated 11 July 2024, 9 months ago

This is kind of an edge case and probably won't occur unless in custom code...
I have found 1 rare use case through contrib where this is also an issue, using https://www.drupal.org/project/section_library

Steps te reproduce:
1/ Setup a content type (node for example) to use layout builder
2/ Create a layout builder block type with a viewsreference field
3/ Enable the section_library module
4/ Add a node with layout builder, add the block with the viewsreference field and configure it
5/ Add this to the section library (at this point it has already gone wrong, but no way to see it)
6/ Add the section from the library somewhere else

Expected result:
The layoutbuilder section with the viewsreference block is fully "cloned".

Actual result:
Everything is cloned but only the "target_id" (view name) is available, all other options are gone: display_id, argument, title, ...

I'm unsure how this happens, but managed to track it down to the fact that if you serialize any entity with a viewsreference field on it, all information except the "target_id" is lost.

Don't know how to fix this...

I'm guessing content export/import modules would also run into this issue since most of them also rely on some sort of serialization.

🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇧🇪Belgium weseze

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom scott_euser

    Apologies for the silence here. We have progressed a fair bit with the module since that point in time, its very likely this is no longer an issue. Could you reopen if you still experience the error?

    Thanks!

Production build 0.71.5 2024