Drupal core follows one of two methods of handling the scenario where an entity's translation is being created/edited, and is has to
present an un-translatable field: Either hide the non-translatable fields during translation (create or edit), or show the field and append " (all languages)" to the field's label. As I understand it, the difference here is whether content is moderated or not.

I wish to hide an IEF field altogether when working in a host-entity form translation and its host entity reference field is configured to not be translatable.

Somewhat related to #2989028: Fix integration with content moderation in multi-lingual scenarios and others dealing with translations, but I don't think it's related to #2901461: Show non-translatable fields instead of hiding them.

Comments

texas-bronius created an issue. See original summary.

texas-bronius’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.82 KB
geek-merlin’s picture

Status: Needs review » Needs work

> As I understand it, the difference here is whether content is moderated or not.

Can you crosslink the core / moderation logic in comments? Also we need to look into the tests.

jasonawant’s picture

Status: Needs work » Postponed (maintainer needs more info)

Isn't the request as follows, satisfied by core's "Hide non translatable fields on translation forms"?

I wish to hide an IEF field altogether when working in a host-entity form translation and its host entity reference field is configured to not be translatable.

Maybe I'm misunderstanding some particulars. Maybe something related to the original poster's comment about

As I understand it, the difference here is whether content is moderated or not.

If the entity bundle is moderated, the "Hide non translatable fields on translation forms" is disabled with help text "Moderated content requires non-translatable fields to be edited in the original language form." In this situation, the field's inline entity form, or any, widget is hidden on the translation form.

Is there something I'm missing? It's been 3 years since the original post, marking postponed (maintainer needs more info).

@geek-merlin asks for a link to the moderation logic. I this this may be part of the logic

https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/modules/cont...

jasonawant’s picture

connbi’s picture

StatusFileSize
new1.46 KB

I have the same problem in IEF 2.0.x and create a new patch for it.

connbi’s picture

connbi’s picture

StatusFileSize
new1016 bytes

I re-checked the logic of IEF 2.0.x, I think it's wrong to add validate in canBuild function, the judgement logic should be added to the section of $elements['#multilingual'] = TRUE;
so I create a new patch!