Skip to content

Commit

Permalink
[BUGFIX] Omit calling getRecordWSOL in BU::getProcessedValue()
Browse files Browse the repository at this point in the history
Since #102616, itemsProcFunc config is resolved in
`BU::getLabelFromItemlist()`. This method therefore
was adjusted to take the record in question as argument,
passing it to the underlying `ItemProcessingService`,
which actually just requires the uid and pid.

Since the database row is not passed to
BU::getProcessedValue()`, the record was
fetched for each item manually via
`getRecordWSOL()`. This is not sufficient
and has a serious performance impact.

The functionality of resolving itemsProcFunc is
now still in place but `BU::getProcessedValue()`
does no longer fetch and pass the record, but
only the uid and pid. This will therefore still
enable most use cases, but does no longer slow
down the backend.

Resolves: #102698
Related: #102616
Related: #100855
Releases: main, 12.4
Change-Id: Ic52564fada13b47f5364df642acbf683538b0c21
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82248
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
o-ba committed Dec 26, 2023
1 parent ae2739d commit b61dfba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typo3/sysext/backend/Classes/Utility/BackendUtility.php
Expand Up @@ -1623,7 +1623,7 @@ public static function getProcessedValue(
$lang = static::getLanguageService();
switch ((string)($theColConf['type'] ?? '')) {
case 'radio':
$l = $lang->sL(self::getLabelFromItemlist($table, $col, $value, static::getRecordWSOL($table, (int)$uid) ?? []));
$l = $lang->sL(self::getLabelFromItemlist($table, $col, $value, ['uid' => (int)$uid, 'pid' => (int)$pid]));
if ($l === '' && !empty($value)) {
// Use plain database value when label is empty
$l = $value;
Expand Down Expand Up @@ -1655,7 +1655,7 @@ public static function getProcessedValue(
$columnTsConfig = $pageTsConfig['TCEFORM.'][$table . '.'][$col . '.'];
}
}
$l = self::getLabelsFromItemsList($table, $col, (string)$value, $columnTsConfig, static::getRecordWSOL($table, (int)$uid) ?? []);
$l = self::getLabelsFromItemsList($table, $col, (string)$value, $columnTsConfig, ['uid' => (int)$uid, 'pid' => (int)$pid]);
if (!empty($theColConf['foreign_table']) && !$l && !empty($GLOBALS['TCA'][$theColConf['foreign_table']])) {
if ($noRecordLookup) {
$l = $value;
Expand Down

0 comments on commit b61dfba

Please sign in to comment.