Paragraph entity fields are not getting saved

Created on 24 March 2020, over 4 years ago
Updated 9 December 2024, 11 days ago

I am trying to save the paragraph referenced in my custom entity. All the other fields are being saved properly but the paragraph entity is not getting saved. The strange thing is I am not seeing any error, neither I am seeing any log in watchdog.

🐛 Bug report
Status

Needs review

Component

Code

Created by

🇮🇳India mehul.shah

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.

  • 🇫🇷France tostinni

    Here is a shot at it.
    The problem is causing by the fact that the function entityShouldBeSaved is only checking base fields of the entity, thus when a reference is present it will only check its target_id which won't change if any of the referenced entity field is changed.

    The patch add a nested logic to drill into fields of entity_reference (nodes, terms, medias...) and entity_reference_revisions (used for paragraphs).

    We had to add a check for $new_field to be a valid field as in some case we had strings., so I guess a few eyeballs on this should help.

  • 🇮🇹Italy robertin0

    Fix in #5 saved my day,
    Thank you

Production build 0.71.5 2024