Project

General

Profile

Actions

Bug #103076

closed

No labels for values configured with TSConfig in backend preview

Added by Klaus Moser 10 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2024-02-07
Due date:
% Done:

100%

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

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.

Actions #1

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

Actions #2

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

Actions #3

Updated by Oliver Bartsch 9 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF