Bug #59192
closedTask #79241: Streamline usage of l10n_mode
mergeIfNotBlank with FAL records
0%
Description
mergeIfNotBlank doesn't seem to play with FAL records. I'm using EXT:news with FAL relations enabled (default as of 3.0). There are two FAL fields:
- Media file (fal_media)
- Related files (fal_related_files)
Both are using ExtensionManagementUtility::getFileFieldTCAConfig
for their file field.
The TCA reference states the following: "Field will be editable but if the field value is blank the value from the default translation is used (this can be very useful for images shared from the default record). Requires frontend support. In the backend the effect is that the field content is not copied when a new "localization copy" is made."
From my understanding, applied to a FAL field this means the following when I localize an item:
Scenario A: I just want to use the files from the original version¶
Expectation:
The sys_file_references are not copied. I see an information about the items that are going to be used if I don't set any new relations:
When I view the localized news, the files from the original version are visible.
Current behaviour, sys_language_mode=strict:
- I don't see any information about the files being used if I don't set any new relations.
- I have no files in the frontend output at all.
Current behaviour, sys_language_mode=content_fallback:
- I don't see any information about the files being used if I don't set any new relations.
- I can see the file references.
Scenario B: I want to use own files for the localized version¶
Expectation:
I add own files. Since the fields are no longer blank in the localized version, only the localized files I added will be displayed.
Current behaviour, sys_language_mode=strict:
No files are displayed at all.
Current behaviour, sys_language_mode=content_fallback:
The files from the default language are displayed, the files from the localized version are ignored.
Possible workaround¶
The only way I can add files at all in a translated item is to change the TCA definition of the field to display the localization buttons:
$TCA['tx_news_domain_model_news']['columns']['fal_related_files'] = array( 'exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => '' . $ll . 'tx_news_domain_model_news.fal_related_files', 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( 'related_files', array( 'appearance' => array( 'showAllLocalizationLink' => 1, 'showSynchronizationLink' => 1, ) ) ) );
Then I see the files from the original language.
sys_language_mode=strict: They are still not displayed in the frontend as it would be expected for "mergeIfNotBlank" fields.
Once I localize the references, the files are displayed. But the meta information is always taken from the default language and cannot be overridden:
Relations that only exist in the localized version are still not displayed at all (both language modes).
I don't know if these are mostly Extbase or non-Extbase issues.
Files