Bug #103076
closedNo labels for values configured with TSConfig in backend preview
100%
Description
Description
Backend preview shows values instead of their labels if configured via TSConfig
Example
Added some items to the tt_content fields space_before_class
and space_after_class
in Typo3 12.4.10 with TSConfig like this:
TCEFORM.tt_content {
space_before_class {
removeItems = extra-small,small,medium,large,extra-large
addItems {
pt-0 = No space
}
}
space_after_class {
removeItems = extra-small,dbgsmall,medium,large,extra-large
addItems {
pb-0 = No space
}
}
}
If I select a custom value for theese fields the preview shows the values instead of their labels.
Abstand davor pt-0 Abstand danach pb-0
The problem is caused by the method getProcessedValue()
in TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer
. In this method BackendUtility::getProcessedValue() is called without the $pid parameter. Therefore the TSConfig will not be loaded and the addItems
part with the labels in it will not be available.
Adding record['pid']
to the call solves the problem, but i'm not sure if this might cause other problems.
$fieldValue = BackendUtility::getProcessedValue('tt_content', $field, $record[$field], 0, false, false, $record['uid'] ?? 0, true, $record['pid'] ?? 0) ?? '';
Maybe some of you Typo3 Gurus can have a look at it.
Updated by Gerrit Code Review 9 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83008
Updated by Gerrit Code Review 9 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82978
Updated by Oliver Bartsch 9 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 4d1095fc45f2c614919be43c563d5a00980de94b.