Skip to content
Snippets Groups Projects
Commit c26dbb33 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Use live record for diff view

The diff view for new and deleted placeholder records,
introduced in #93620, used the current version record
for the generation of the diff view.

Since corresponding relations (live and version) do always
contain the live records' uid as foreign_field value, the diff
view generation must also use the live record. Especially
since this does not make any difference when dealing with
new or delete placeholder.

Note: New placeholders were removed in v11, so this fix only
applies to delete placeholders in v11.

Resolves: #93970
Releases: master, 10.4
Change-Id: I2f86d865ed3c03ca6153bb02f2058ff8a369b4c1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68840


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent 9827a72a
Branches
Tags
No related merge requests found
......@@ -216,18 +216,18 @@ class RemoteServer
];
} elseif ($isNewOrDeletePlaceholder && isset($suitableFields[$fieldName])) {
// If this is a new or delete placeholder, add diff view for all appropriate fields
$versionRecord[$fieldName] = BackendUtility::getProcessedValue(
$newOrDeleteRecord[$fieldName] = BackendUtility::getProcessedValue(
$parameter->table,
$fieldName,
$versionRecord[$fieldName],
$liveRecord[$fieldName], // Both (live and version) values are the same
0,
true,
false,
$versionRecord['uid']
$liveRecord['uid'] // Relations of new/delete placeholder do always contain the live uid
) ?? '';
// Don't add empty fields
if ($versionRecord[$fieldName] === '') {
if ($newOrDeleteRecord[$fieldName] === '') {
continue;
}
......@@ -235,23 +235,15 @@ class RemoteServer
'field' => $fieldName,
'label' => $fieldTitle,
'content' => $versionState->equals(VersionState::NEW_PLACEHOLDER)
? $diffUtility->makeDiffDisplay('', $versionRecord[$fieldName])
: $diffUtility->makeDiffDisplay($versionRecord[$fieldName], '')
? $diffUtility->makeDiffDisplay('', $newOrDeleteRecord[$fieldName])
: $diffUtility->makeDiffDisplay($newOrDeleteRecord[$fieldName], '')
];
// Generally not needed by Core, but let's make it available for further processing in hooks
$liveReturnArray[] = [
'field' => $fieldName,
'label' => $fieldTitle,
'content' => BackendUtility::getProcessedValue(
$parameter->table,
$fieldName,
(string)$liveReturnArray[$fieldName],
0,
true,
false,
$liveReturnArray['uid']
)
'content' => $newOrDeleteRecord[$fieldName]
];
} elseif ((string)$liveRecord[$fieldName] !== (string)$versionRecord[$fieldName]) {
// Select the human readable values before diff
......
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