Commit 9e9970af authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Properly resolve field values in content preview

The StandardContentPreviewRenderer runs
through a list of fields, whose value should
be processed and displayed in the footer.

Some of those field values might be a reference
to a foreign table, e.g. in the "fe_group" field.
Due to changes in getProcessedValue(), it's
necessary to provide the records' uid, to be
able to resolve values of fields with a
"foreign_table" configuration.

Resolves: #96920
Releases: main, 11.5
Change-Id: I0d8739710e478a7cb264be1d5b90b70af31de964
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73563


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 25773e86
...@@ -293,8 +293,8 @@ class StandardContentPreviewRenderer implements PreviewRendererInterface, Logger ...@@ -293,8 +293,8 @@ class StandardContentPreviewRenderer implements PreviewRendererInterface, Logger
$fieldArr = explode(',', $fieldList); $fieldArr = explode(',', $fieldList);
foreach ($fieldArr as $field) { foreach ($fieldArr as $field) {
if ($record[$field]) { if ($record[$field]) {
$info[] = '<strong>' . htmlspecialchars((string)($itemLabels[$field] ?? '')) . '</strong> ' $fieldValue = BackendUtility::getProcessedValue('tt_content', $field, $record[$field], 0, false, false, $record['uid'] ?? 0) ?? '';
. htmlspecialchars(BackendUtility::getProcessedValue('tt_content', $field, $record[$field]) ?? ''); $info[] = '<strong>' . htmlspecialchars((string)($itemLabels[$field] ?? '')) . '</strong> ' . htmlspecialchars($fieldValue);
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment