#106303Image description of sys_file_reference is not translated in frontend
Description
1. Prerequisites
I have setup a clean environment to reproduce the issue.
Basic Setup with DDEV
PHP 8.3
TYPO3 13.4.5
Setup at least 2 languages with strict fallback (0 = English, 1 = German).
2. Steps to reproduce
2.1 Add the following Typoscript Configuration
For simplicity I added a PageView in the fluid_styled_content extension.
Typoscript Configuration
page = PAGE
# Working variant
page.100 = CONTENT
page.100 {
table = tt_content
select {
orderBy = sorting
where = {#colPos}=0
}
}
# Not working variant
page.101 = PAGEVIEW
page.101 {
paths {
100 = EXT:fluid_styled_content/Resources/Private/PageView/
}
dataProcessing {
10 = page-content
20 = menu
20.as = mainMenu
}
}
2.2 Add Page template in fluid_styled_content extension
EXT:fluid_styled_content/Resources/Private/PageView/Page/Default.html
<f:debug>{_all}</f:debug>
<f:for each="{content.main.records}" as="contentElement">
<f:cObject
typoscriptObjectPath="{contentElement.mainType}"
table="{contentElement.mainType}"
data="{contentElement}"
/>
</f:for>
2.4 Insert Text & Images
Insert a text & images content element in 2 languages. Set the specific image description in all languages in the file reference.
3. Actual Results
The image description is the English image description.
4. Expected Results
The image description is the translated (German) description.
5. Additional Notes
The localization works if I do not use the PAGEVIEW Object. see typoscript configuration. And the upper part of the previous screenshot
TYPO3\CMS\Frontend\Resource\FileCollector::getFileReferences()L:291 checks if _LOCALIZED_CONTENT is set on the content element which is not the case (data debug output below).
Therefore, in L:297 the Record is not localized
@if ($isTableLocalizable && $localizedId !== null)@
The RawRecord itself has set the computedProperty localizedUid
TYPO3_BugRecordsDebug.png
The property is lost when toArray is called on the Record, which is what gets fed to the FileProcessor.
TYPO3_BugDataDebug.png
TYPO3\CMS\Core\Domain\RawRecord::toArray() does not use the computedProperties which contains the localizedUid.
If I change the toArray function of RawRecord to the following, the image descriptions get localized correctly.
public function toArray(): array
{
return $this->properties + ['uid' => $this->uid, 'pid' => $this->pid, '_LOCALIZED_UID' => $this->getComputedProperties()->getLocalizedUid()];
}Reviews 8
- 13.4 90846[BUGFIX] Consider already existing _computed in raw record
- main 90539[BUGFIX] Consider already existing _computed in raw record
- 13.4 89168[BUGFIX] Include computed properties in CObject ViewHelper
- main 89157[BUGFIX] Include computed properties in CObject ViewHelper
- 13.4 88777[BUGFIX] Revert interface change in Record API
- main 88776[BUGFIX] Revert interface change in Record API
- main 88482[BUGFIX] Provide _LOCALIZED_UID in RawRecord
- 13.4 88775[BUGFIX] Provide _LOCALIZED_UID in RawRecord
Related issues 3
Files 4
History 614
-
Gerrit Code Review pushed patch set 1 for main to change 88482 status
NewUnder Review 03/04/25, 16:20 -
Gerrit Code Review pushed patch set 2 for main to change 88482 03/18/25, 10:10
-
Gerrit Code Review pushed patch set 3 for main to change 88482 03/21/25, 19:24
-
Gerrit Code Review pushed patch set 4 for main to change 88482 03/21/25, 19:24
-
Gerrit Code Review pushed patch set 5 for main to change 88482 03/21/25, 19:50
-
Gerrit Code Review pushed patch set 6 for main to change 88482 03/22/25, 09:28
-
Gerrit Code Review pushed patch set 7 for main to change 88482 03/26/25, 13:56
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88775 03/26/25, 15:28
-
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % 03/26/25, 15:30 -
Benni Mack changed Related to #106441 03/26/25, 16:21
-
Dmytro Doronenko changed Related to #106554 04/11/25, 11:03
-
Matthias Kappenberg commented 04/16/25, 12:05
The patch is missing:
$properties += ['uid' => $this->uid, 'pid' => $this->pid]; to $properties += ['uid' => $this->uid, 'pid' => $this->pid, '_LOCALIZED_UID' => $this->getComputedProperties()->getLocalizedUid()];Without the above-mentioned change, it is not working here.
-
Nikita Hovratov changed Related to #107195 08/15/25, 17:44
-
Benni Mack changed status
ResolvedClosed 12/02/25, 14:22
Applied in changeset commit:c3240dec4e9dd8323ff9300adbd1044becfd4691.