Skip to content

Commit f7f0882

Browse files
committed
[BUGFIX] Always use getProcessedValue for detail view in Workspace Module
This change ensures to always have the full row (versioned / live) to do a comparison in the workspaces module DetailView. This allows to use getProcessedValue() which e.g. resolves the proper colPos title when moving a content element into a different colPos with a custom backend layout. Resolves: #91667 Releases: main, 13.4 Change-Id: I2135cffa44c4ce4103ea2d2e6a802870c8653488 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/89092 Reviewed-by: Georg Ringer <georg.ringer@gmail.com> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: core-ci <typo3@b13.com> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Georg Ringer <georg.ringer@gmail.com> Tested-by: Benni Mack <benni@typo3.org>
1 parent 5fc2d8e commit f7f0882

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

typo3/sysext/workspaces/Classes/Controller/Remote/RemoteServer.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ public function getRowDetails(\stdClass $parameter): array
124124
$schema = $this->tcaSchemaFactory->get($table);
125125
$diffReturnArray = [];
126126
$liveReturnArray = [];
127-
$liveRecord = (array)BackendUtility::getRecord($table, $parameter->t3ver_oid);
128-
$versionRecord = (array)BackendUtility::getRecord($table, $parameter->uid);
127+
$plainLiveRecord = $liveRecord = (array)BackendUtility::getRecord($table, $parameter->t3ver_oid);
128+
$plainVersionRecord = $versionRecord = (array)BackendUtility::getRecord($table, $parameter->uid);
129129
$versionState = VersionState::tryFrom($versionRecord['t3ver_state'] ?? 0);
130130
$iconWorkspace = $this->iconFactory->getIconForRecord($table, $versionRecord, IconSize::SMALL);
131131
$stagePosition = $this->stagesService->getPositionOfCurrentStage($parameter->stage);
@@ -137,6 +137,7 @@ public function getRowDetails(\stdClass $parameter): array
137137
continue;
138138
}
139139
// Disable internal fields
140+
// l10n_diffsource is not needed, see #91667
140141
if ($schema->isLanguageAware() && $schema->getCapability(TcaSchemaCapability::Language)->getDiffSourceField()?->getName() === $fieldName) {
141142
continue;
142143
}
@@ -207,7 +208,7 @@ public function getRowDetails(\stdClass $parameter): array
207208
];
208209
} elseif ($isNewOrDeletePlaceholder && isset($suitableFields[$fieldName])) {
209210
// If this is a new or delete placeholder, add diff view for all appropriate fields
210-
$newOrDeleteRecord[$fieldName] = $this->formatValue($table, $fieldName, (string)$liveRecord[$fieldName], $liveRecord['uid'], $configuration);
211+
$newOrDeleteRecord[$fieldName] = $this->formatValue($table, $fieldName, (string)$liveRecord[$fieldName], $liveRecord['uid'], $configuration, $plainLiveRecord);
211212

212213
// Don't add empty fields
213214
if ($newOrDeleteRecord[$fieldName] === '') {
@@ -230,8 +231,8 @@ public function getRowDetails(\stdClass $parameter): array
230231
];
231232
} elseif ((string)$liveRecord[$fieldName] !== (string)$versionRecord[$fieldName]) {
232233
// Select the human-readable values before diff
233-
$liveRecord[$fieldName] = $this->formatValue($table, $fieldName, (string)$liveRecord[$fieldName], $liveRecord['uid'], $configuration);
234-
$versionRecord[$fieldName] = $this->formatValue($table, $fieldName, (string)$versionRecord[$fieldName], $versionRecord['uid'], $configuration);
234+
$liveRecord[$fieldName] = $this->formatValue($table, $fieldName, (string)$liveRecord[$fieldName], $liveRecord['uid'], $configuration, $plainLiveRecord);
235+
$versionRecord[$fieldName] = $this->formatValue($table, $fieldName, (string)$versionRecord[$fieldName], $versionRecord['uid'], $configuration, $plainVersionRecord);
235236
$fieldDifferences = $this->diffUtility->diff(strip_tags($liveRecord[$fieldName]), strip_tags($versionRecord[$fieldName]), $granularity);
236237
$diffReturnArray[] = [
237238
'field' => $fieldName,
@@ -298,12 +299,12 @@ public function getRowDetails(\stdClass $parameter): array
298299
];
299300
}
300301

301-
protected function formatValue(string $table, string $fieldName, string $value, int $uid, array $tcaConfiguration): string
302+
protected function formatValue(string $table, string $fieldName, string $value, int $uid, array $tcaConfiguration, array $fullRow): string
302303
{
303304
if (($tcaConfiguration['type'] ?? '') === 'flex') {
304305
return $this->flexFormValueFormatter->format($table, $fieldName, $value, $uid, $tcaConfiguration);
305306
}
306-
return (string)BackendUtility::getProcessedValue($table, $fieldName, $value, 0, true, false, $uid);
307+
return (string)BackendUtility::getProcessedValue($table, $fieldName, $value, 0, true, false, $uid, true, (int)$fullRow['pid'], $fullRow);
307308
}
308309

309310
/**

0 commit comments

Comments
 (0)