- 🇦🇹Austria fago Vienna
Patch is straight forward and comes with test coverage. Works without issues still, please merge!
- Status changed to Needs work
over 1 year ago 3:49pm 6 April 2023 - 🇦🇹Austria arthur_lorenz Vienna
This patch only works well on simple fields like text fields. On more complex fields, e.g.
entity_reference_revisions
, you are not able to translate the referenced entity and its fields. - 🇸🇮Slovenia useernamee Ljubljana
I can confirm what arthur_lorenz wrote - this patch breaks complex fields translatability. We have paragraph blocks and their fields are translatable if this patch is not used. When this patch is applied, fields on paragraphs in block are no longer translatable.
- 🇦🇹Austria fago Vienna
so what about having a list of form-widgets that are still shown? we could make a simple hook that allows modules to add more form widgets to the list.
- 🇸🇮Slovenia useernamee Ljubljana
@fago When making paragraphs translatable entity revision field should not be made translatable on the parent entity ( docs → ). So I guess patch from #8 works as expected but when using inline form widgets, it's effect is just not desirable. So to make things a bit more clear, where should the logic to not hide the field be configured - should it be per content type, per field or site-wide per widget? So the end result would be hide untranslatable fields except for widget we don't want too.
- 🇦🇹Austria fago Vienna
I don't think it needs config, why not generally allow known widgets like inline-form-widgets? The hook would be for allowing modules to add further widgets.
- heddn Nicaragua
+++ b/src/Form/BlockContentInlineBlockTranslateForm.php @@ -136,6 +137,18 @@ final class BlockContentInlineBlockTranslateForm extends BlockContentForm { + if (($field_definition = $this->entity->getFieldDefinition($key))
Could we add:
$ignored_types = array_flip(['actions', 'value', 'hidden', 'vertical_tabs', 'token', 'details', 'link']);
// Ignore non-widget form elements.
if (isset($ignored_types[$form[$key]['#type']])) {
continue;
}Would that resolve the paragraphs fields?