Project

General

Profile

Actions

Bug #89197

open

FileCollector and allowLanguageSynchronization for FAL fields

Added by Francois Suter about 5 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2019-09-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

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 \TYPO3\CMS\Frontend\Resource\FileCollector class.

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

Actions #1

Updated by Torben Hansen almost 4 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)

Actions #2

Updated by Philipp Wrann almost 3 years ago

  • Category changed from File Abstraction Layer (FAL) to Frontend
  • TYPO3 Version changed from 9 to 11
  • PHP Version deleted (7.2)

Just stumbled over this.

Its true for all Versions of TYPO3. The implementation of FileCollector::getFileReferences is flawed/wrong.

Please prioritize this issue.

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/frontend/Classes/Resource/FileCollector.php#L290

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.

Actions

Also available in: Atom PDF