diff --git a/core/bulkchange.class.inc.php b/core/bulkchange.class.inc.php index 8dd01b6ec..ad3572281 100644 --- a/core/bulkchange.class.inc.php +++ b/core/bulkchange.class.inc.php @@ -550,6 +550,8 @@ class BulkChange // if (!array_key_exists($sAttCode, $this->m_aAttList)) continue; $oExtKey = MetaModel::GetAttributeDef(get_class($oTargetObj), $sAttCode); + //remove any loaded value to avoid problems with data already in memory due to previous operations + $oExtKey->RemoveLoaded(); if ($this->IsNullExternalKeySpec($aRowData, $sAttCode)) { foreach ($aReconKeys as $sReconKeyAttCode => $iCol) { diff --git a/core/valuesetdef.class.inc.php b/core/valuesetdef.class.inc.php index 8a9c91494..3374b5baa 100644 --- a/core/valuesetdef.class.inc.php +++ b/core/valuesetdef.class.inc.php @@ -179,6 +179,11 @@ class ValueSetObjects extends ValueSetDefinition return new DBObjectSet($oFilter, $this->m_aOrderBy, $aArgs); } + public function RemoveLoaded() + { + $this->m_bIsLoaded = false; + } + /** * @inheritDoc * @throws CoreException diff --git a/sources/Core/AttributeDefinition/AttributeExternalKey.php b/sources/Core/AttributeDefinition/AttributeExternalKey.php index 10783fffb..7c9b77aa8 100644 --- a/sources/Core/AttributeDefinition/AttributeExternalKey.php +++ b/sources/Core/AttributeDefinition/AttributeExternalKey.php @@ -153,7 +153,13 @@ class AttributeExternalKey extends AttributeDBFieldVoid return $oValSetDef; } - + public function RemoveLoaded() + { + $oValSetDef = $this->Get("allowed_values"); + if ($oValSetDef) { + $oValSetDef->RemoveLoaded(); + } + } public function GetAllowedValues($aArgs = [], $sContains = '') { //throw new Exception("GetAllowedValues on ext key has been deprecated");