Problem/Motivation
FieldTranslationSynchronizer keeps columns of a multi-column translatable field that are not flagged as translatable in sync.
However, if some columns are not included in the set of columns in the annotation, they will not be synchronized, even though they are not translatable and should be kept in sync.
Proposed resolution
Fetch the full list of columns and sync any that are not in any column group.
Remaining tasks
User interface changes
N/A
API changes
Edge-case behavior change for multi-column translatable fields.
========
More details:
\Drupal\content_translation\FieldTranslationSynchronizer bases its behavior off the column_groups defined in a field item plugin annotation:
/**
* Plugin implementation of the 'image' field type.
*
* @FieldType(
* id = "image",
* label = @Translation("Image"),
* description = @Translation("This field stores the ID of an image file as an integer value."),
* default_widget = "image_image",
* default_formatter = "image",
* column_groups = {
* "file" = {
* "label" = @Translation("File"),
* "columns" = {
* "target_id", "width", "height"
* }
* },
* "alt" = {
* "label" = @Translation("Alt"),
* "translatable" = TRUE
* },
* "title" = {
* "label" = @Translation("Title"),
* "translatable" = TRUE
* },
* },
* list_class = "\Drupal\file\Plugin\Field\FieldType\FileFieldItemList",
* constraints = {"ValidReference" = {}, "ReferenceAccess" = {}}
* )
*/
class ImageItem extends FileItem { }
You define translatable column group in column_groups which are then exposed as translatable setting. however, currently all columns must be included in some group.
Comments
Comment #1
Gábor HojtsyFixing tags and priority.
Comment #13
LendudeThis issue came up as a random Bug smash issue during a triage session.
#2496867: Translatable image file is not working unless you also config the image field. Config can get lost anyway. added the 'require_all_groups_for_translation' key, which, I think, covers this case.
I'm going to close this as a duplicate of that issue. If you feel there is still an edge case where this isn't covered by the new key, please feel free to reopen this with steps to reproduce the issue.