FileCollector and allowLanguageSynchronization for FAL fields
Consider a FAL field with behavior/allowLanguageSynchronization set to true. In general when FAL relations are rendered in the frontend, the files have been fetched using the
Now when I translate some element with FAL relations and check the option "Value of default language", I would expect the FileCollector to know about this and to send me back the images from the original language.
Instead FileCollector checks if the element is a translation (by checking the existence of the
_LOCALIZED_UID field in the incoming data) and tries to get the sys_file_reference records strictly related to the translations. If it finds none, it still overrides the list of items it found previously related to the original language (which is actually a waste of resources, it is useless to query something and override it anyway, so the logic in
\TYPO3\CMS\Frontend\Resource\FileCollector::getFileReferences() could be also improved (on top of fixing this bug)).
Updated by Torben Hansen almost 3 years ago
In addition, when translation behavior is set to "Custom value" the usage of
_LOCALIZED_UID for fetching the sys_file_reference of the default language it totally wrong, since this leads to an exception, when the record in the default language is hidden.
Problem still present in TYPO3 10.4 (and probably 11.x)
Updated by Philipp Wrann almost 2 years ago
- Category changed from File Abstraction Layer (FAL) to Frontend
- TYPO3 Version changed from 9 to 11
- PHP Version deleted (
Just stumbled over this.
Its true for all Versions of TYPO3. The implementation of FileCollector::getFileReferences is flawed/wrong.
Please prioritize this issue.
The method would be able to analyze the state of localizations and chose either uid, or l10n_parent or l10n_source from the given element, not much required for that as it seems to me.
In my case i added a XCLASS, that checks if l10n_state is set in the given element. If so and the parsed state contains the fieldName, i return the relations from the configured field, elsewise i call the parents method.