Index: kernel/db/dbitem.php =================================================================== --- kernel/db/dbitem.php (revision 12677) +++ kernel/db/dbitem.php (working copy) @@ -68,6 +68,13 @@ */ var $ID; + /** + * This object is used in cloning operations + * + * @var bool + */ + var $inCloning = false; + function kDBItem() { parent::kDBBase(); @@ -1255,7 +1262,7 @@ function saveCustomFields() { - if (!$this->customFields) { + if (!$this->customFields || $this->inCloning) { return true; } Index: kernel/utility/temp_handler.php =================================================================== --- kernel/utility/temp_handler.php (revision 12677) +++ kernel/utility/temp_handler.php (working copy) @@ -295,7 +295,9 @@ $this->RaiseEvent('OnBeforeClone', $master['Prefix'], $special, Array($object->GetId()), $foreign_key); } + $object->inCloning = true; $res = $mode == 'update' ? $object->Update() : $object->Create(); + $object->inCloning = false; if ($res) { Index: units/custom_data/custom_data_config.php =================================================================== --- units/custom_data/custom_data_config.php (revision 12677) +++ units/custom_data/custom_data_config.php (working copy) @@ -33,7 +33,7 @@ 'ParentTableKey' => 'ResourceId', 'ForeignKey' => 'ResourceId', 'AutoDelete' => true, - 'AutoClone' => false, + 'AutoClone' => true, 'CalculatedFields' => Array ( '' => Array(),