Issue Bug Closed

#83140Images not shown when metadata is translated

Patrick Broens 11/28/17, 15:57 updated 11/29/17, 21:00

Description

How to reproduce:
  • Have at least one extra language
  • Upload image in filelist
  • Fill the metadata
  • Translate the metadata of this image
  • Make a content element of type “image” in default language
  • Make reference to this image in the content element
  • Translate the content of this page
  • Show translated page in frontend
Result:
  • The image is not there, the translated metadata is shown
  • The img tag is using 0 (zero) for both width and height

*Reason:*
The column type of width and height are not declared in sys_file_metadata
When declaring the type input for these fields, probably with a readOnly => true, the image is shown again, because the contents of the width and height column are transferred to the translation using l10n_mode = exclude

When adding the following to Configuration/TCA/Overrides/sys_file_metadata.php in my own extension it works

$GLOBALS['TCA']['sys_file_metadata'] = array_replace_recursive(
    $GLOBALS['TCA']['sys_file_metadata'],
    [
        'columns' => [
            'width' => [
                'config' => [
                    'type' => 'input',
                    'readOnly' => true
                ]
            ],
            'height' => [
                'config' => [
                    'type' => 'input',
                    'readOnly' => true
                ]
            ],
        ]
    ]
);

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.