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)).