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.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3108400-8.patch | 1016 bytes | connbi |
| #2 | 3108400_inline_entity_form-hide_on_translation_when_host_field_is_nontranslatable.patch | 1.82 KB | texas-bronius |
Comments
Comment #2
texas-bronius commentedComment #3
geek-merlin> 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.
Comment #4
jasonawantIsn't the request as follows, satisfied by core's "Hide non translatable fields on translation forms"?
Maybe I'm misunderstanding some particulars. Maybe something related to the original poster's comment about
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...
Comment #5
jasonawant#2989028: Fix integration with content moderation in multi-lingual scenarios seems related
Comment #6
connbi commentedI have the same problem in IEF 2.0.x and create a new patch for it.
Comment #7
connbi commentedComment #8
connbi commentedI 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!