Paragraphs translations aren't always updated

Created on 28 June 2023, 12 months ago
Updated 20 March 2024, 3 months ago

Problem/Motivation

The changes made in https://www.drupal.org/project/tmgmt/issues/3207993 πŸ› Paragraphs translations aren't updated when imported with file import (with Auto accept finished translations enabled) Fixed are causing some instances of paragraphs not to save.

Steps to reproduce

I was using a site setting entity with a paragraphs field.
When importing a translation with auto accept enabled the paragraphs are not updated.
I couldn't reproduce this with nodes, so I assume this might be something to do with the host entity not having revisions enabled but using an entity_reference_revision field, but this is just a guess and I wasn't able to confirm this.

Proposed resolution

I have tracked the cause of this, down to a change in https://www.drupal.org/project/tmgmt/issues/3207993 πŸ› Paragraphs translations aren't updated when imported with file import (with Auto accept finished translations enabled) Fixed
The commit 9c9a3391951d461bcd23d3c0a9653b54bd29a7b9 incorrectly calls $target_entity->needsSave(); however this is just a method for returning the status of needsSave
It should be calling $target_entity->setNeedsSave(TRUE);

Once I made this change the paragraphs then correctly updated on import

πŸ› Bug report
Status

RTBC

Version

1.0

Component

Source: Entity

Created by

πŸ‡¬πŸ‡§United Kingdom paulmartin84

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

Comments & Activities

Production build 0.69.0 2024