Computed fields and not translatable fields from paragraphs are being translated

Created on 21 August 2023, almost 2 years ago

Problem/Motivation

When creating a new job that comprises a node with paragraphs and computed fields, both the computed fields and the not translatable fields from paragraphs are being offered to translate. Either computed fields and not translatable fields must not be translated.

Steps to reproduce

Create a node with an entity reference to a paragraph that has no translatable fields. As Paragraphs module states, the entity reference field MUST NOT be translatable. Only the paragraph bundle and the paragraphs fields could be.

Proposed resolution

Change the translatable fields resolutor algorightm from ContentEntitySource class.

πŸ› Bug report
Status

Active

Version

1.15

Component

Source: Entity

Created by

πŸ‡ͺπŸ‡ΈSpain vidorado LogroΓ±o (La Rioja)

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

Comments & Activities

  • Issue created by @vidorado
  • πŸ‡ͺπŸ‡ΈSpain vidorado LogroΓ±o (La Rioja)
  • πŸ‡©πŸ‡ͺGermany spuky

    Thanks for the patch...

    I cleaned it up to only have the inteded changes..

    you got a lot of redirects in there too...

  • πŸ‡ͺπŸ‡ΈSpain vidorado LogroΓ±o (La Rioja)

    Agg, thanks @spuky, what a mistake!

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 8
    last update over 1 year ago
    Patch Failed to Apply
  • πŸ‡ΊπŸ‡ΈUnited States recrit
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 8
    last update over 1 year ago
    Patch Failed to Apply
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 8
    last update over 1 year ago
    105 pass, 9 fail
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    fixed corrupted patch from #3

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    this change logically makes sense to me - exclude fields with no storage, exclude computed fields. Per the failed test https://www.drupal.org/pift-ci-job/2816543 β†’ , it looks like some of the automated tests may need to be updated for this change.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    We just wondered why untranslatable paragraphs fields suddenly had translated values. In our case it was a field to set custom classes on the paragraph (mb-none) and after tmgmt translation by a user, the class was suddenly "mb-keine" (German).

    Setting priority to Major. The patch LGTM, but I think it needs a tmgmt maintainer to take a look to ensure the logic is correct!

  • πŸ‡³πŸ‡±Netherlands coretex Deurne

    We encounter the same issue where untranslatable paragraph fields, such as a field for classes (e.g., m-auto being translated to m-car), are being translated. We use a paragraph called "Settings," which includes several fields for enhancing a parent paragraph by adding classes or animations. This "Settings" paragraph is linked to all other paragraphs via an Entity Reference Revisions field and does not require translation.

    The content translation is disabled for the "Settings" paragraph, but this causes it to not function as expected: the fields are being translated. When we enable content translation, the untranslatable fields are no longer translated, and everything works. While this solution works for now, it feels like an unintended workaround rather than the expected behavior.

  • πŸ‡­πŸ‡·Croatia Aporie

    Stomping into a similar issue (non-translatable field from a paragraph being translated), I'm wondering if the best approach wouldn't simply to apply a filter from the most specific to the less specific granularity.

    Regarding computed fields, aren't they available in the translation UI? Then it should be a matter of configuration, rather than hard-coding a specific use case?

    I'm posting a patch for reference and RTBC. Haven't had time to test it myself, or even to use it. We just configured our bundle as translatable in my project, so it would pass the code logic and our field got removed from the job item.

Production build 0.71.5 2024