Skip to content
Snippets Groups Projects
Commit 6e9fd7da authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[FEATURE] Introduce shadowColumnsForMovePlaceholders property

$TCA[<table>]['ctrl']['shadowColumnsForMovePlaceholders'] behaves
similar to shadowColumnsForNewPlaceholders but is only used for
move placeholders.

If shadowColumnsForMovePlaceholders is not defined in particular
for a table, but shadowColumnsForNewPlaceholders is defined,
then that value is used as a fallback - since that property
existed for a longer time already.

Resolves: #56994
Documentation: #56749
Releases: 6.2
Change-Id: Icdbd35234efae8162cfb2dc15a2838acd22370b1
Reviewed-on: https://review.typo3.org/28473
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
parent 2cd4683c
No related merge requests found
......@@ -1210,6 +1210,26 @@ class DataHandlerHook {
// First, we create a placeholder record in the Live workspace that
// represents the position to where the record is eventually moved to.
$newVersion_placeholderFieldArray = array();
// Use property for move placeholders if set (since TYPO3 CMS 6.2)
if (isset($GLOBALS['TCA'][$table]['ctrl']['shadowColumnsForMovePlaceholders'])) {
$shadowColumnsForMovePlaceholder = $GLOBALS['TCA'][$table]['ctrl']['shadowColumnsForMovePlaceholders'];
// Fallback to property for new placeholder (existed long time before TYPO3 CMS 6.2)
} elseif (isset($GLOBALS['TCA'][$table]['ctrl']['shadowColumnsForNewPlaceholders'])) {
$shadowColumnsForMovePlaceholder = $GLOBALS['TCA'][$table]['ctrl']['shadowColumnsForNewPlaceholders'];
}
// Set values from the versioned record to the move placeholder
if (!empty($shadowColumnsForMovePlaceholder)) {
$versionedRecord = BackendUtility::getRecord($table, $wsUid);
$shadowColumns = GeneralUtility::trimExplode(',', $shadowColumnsForMovePlaceholder, TRUE);
foreach ($shadowColumns as $shadowColumn) {
if (isset($versionedRecord[$shadowColumn])) {
$newVersion_placeholderFieldArray[$shadowColumn] = $versionedRecord[$shadowColumn];
}
}
}
if ($GLOBALS['TCA'][$table]['ctrl']['crdate']) {
$newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['crdate']] = $GLOBALS['EXEC_TIME'];
}
......
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