Project

General

Profile

Feature #58611 » typo3-cms-core-disable-copying-children-with-parent.patch

Mathias Brodala, 2020-05-05 13:24

View differences:

Classes/DataHandling/DataHandler.php 2020-05-05 13:06:12.974036057 +0200
{
// Process references and files, currently that means only the files, prepending absolute paths (so the DataHandler engine will detect the file as new and one that should be made into a copy)
$value = $this->copyRecord_procFilesRefs($conf, $uid, $value);
$inlineSubType = $this->getInlineFieldType($conf);
// Get the localization mode for the current (parent) record (keep|select):
$localizationMode = BackendUtility::getInlineLocalizationMode($table, $field);
// Register if there are references to take care of or MM is used on an inline field (no change to value):
if ($this->isReferenceField($conf) || $inlineSubType === 'mm') {
$value = $this->copyRecord_processManyToMany($table, $uid, $field, $value, $conf, $language, $localizationMode, $inlineSubType);
} elseif ($inlineSubType !== false) {
$value = $this->copyRecord_processInline($table, $uid, $field, $value, $row, $conf, $realDestPid, $language, $workspaceOptions, $localizationMode, $inlineSubType);
$copyChildrenWithParent = !isset($conf['behaviour']['disableCopyingChildrenWithParent']) || !$conf['behaviour']['disableCopyingChildrenWithParent'];
if ($copyChildrenWithParent) {
$inlineSubType = $this->getInlineFieldType($conf);
// Get the localization mode for the current (parent) record (keep|select):
$localizationMode = BackendUtility::getInlineLocalizationMode($table, $field);
// Register if there are references to take care of or MM is used on an inline field (no change to value):
if ($this->isReferenceField($conf) || $inlineSubType === 'mm') {
$value = $this->copyRecord_processManyToMany($table, $uid, $field, $value, $conf, $language, $localizationMode, $inlineSubType);
} elseif ($inlineSubType !== false) {
$value = $this->copyRecord_processInline($table, $uid, $field, $value, $row, $conf, $realDestPid, $language, $workspaceOptions, $localizationMode, $inlineSubType);
}
} else {
$value = 0;
}
// For "flex" fieldtypes we need to traverse the structure for two reasons: If there are file references they have to be prepended with absolute paths and if there are database reference they MIGHT need to be remapped (still done in remapListedDBRecords())
if ($conf['type'] === 'flex') {
(1-1/2)