Infinite loop for entity reference fields translation

Created on 15 March 2019, almost 6 years ago
Updated 25 September 2024, 3 months ago

I have a node with entity reference field to same type of entity (e.g. field_next_node) and when I try to save the node I get an infinite loop on Drupal\tmgmt_content\Plugin\tmgmt\Source\ContentEntitySource->extractTranslatableData(Object) (Line: 196)

From what I found, referenced entities are translated by loading them and recursively calling the extractTranslatableData() method for each field. I know I can implement hook_tmgmt_translatable_fields_alter(), but should't be a limit on loading referenced entities?

And also, what I think is strange is the fact that the reference fields is not set as translatable in content translation. Why are these fields passed to tmgmt_content?

🐛 Bug report
Status

Postponed: needs info

Version

1.7

Component

Source: Entity

Created by

🇷🇴Romania mariusdiacu Timisoara

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.

  • 🇷🇺Russia shra

    We had the same issue. As a result it was: "Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)" when you try to create new job item.
    So I made a small patch to fix the problem.

  • 🇷🇺Russia shra

    The patch:

  • 🇹🇭Thailand AlfTheCat

    I ran into this problem as well, my server overloaded and produced a WSOD when I attempted to translate Commerce entities. I unchecked all the references in the TMGMT settings UI and that solved the issue.

    I tried the patch from #4 but it failed.

  • 🇨🇭Switzerland berdir Switzerland

    Per #2, automatic embedding of references should _only_ be done for specific things like paragraphs that are part of the main entity, for related things, use suggestions.

  • 🇹🇭Thailand AlfTheCat

    Hi @berdir thanks for clarifying, that's good to know.

    Would it be appreciated if I opened a feature request for this? The thing is that suggestions are not available in automated workflows where AI is leveraged for translating entities. It would be useful in those scenarios to have a global setting just like this where referenced entities get translated automatically.

    Thanks.

  • 🇨🇭Switzerland berdir Switzerland

    That could be a useful option, automatically including suggestions on continuous jobs. Will not be able to handle updates on those references though, so might be better to have a separate continuous job for whatever it is that you want to have translated, like medias or menu links or whatever.

Production build 0.71.5 2024