N°9100 - CSVImport: during creation test on hierarchicalKey don't work as expected

This commit is contained in:
Anne-Cath
2026-01-16 10:41:25 +01:00
parent a39234f438
commit da1e83b3b3
3 changed files with 14 additions and 1 deletions

View File

@@ -550,6 +550,8 @@ class BulkChange
// if (!array_key_exists($sAttCode, $this->m_aAttList)) continue; // if (!array_key_exists($sAttCode, $this->m_aAttList)) continue;
$oExtKey = MetaModel::GetAttributeDef(get_class($oTargetObj), $sAttCode); $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)) { if ($this->IsNullExternalKeySpec($aRowData, $sAttCode)) {
foreach ($aReconKeys as $sReconKeyAttCode => $iCol) { foreach ($aReconKeys as $sReconKeyAttCode => $iCol) {

View File

@@ -179,6 +179,11 @@ class ValueSetObjects extends ValueSetDefinition
return new DBObjectSet($oFilter, $this->m_aOrderBy, $aArgs); return new DBObjectSet($oFilter, $this->m_aOrderBy, $aArgs);
} }
public function RemoveLoaded()
{
$this->m_bIsLoaded = false;
}
/** /**
* @inheritDoc * @inheritDoc
* @throws CoreException * @throws CoreException

View File

@@ -153,7 +153,13 @@ class AttributeExternalKey extends AttributeDBFieldVoid
return $oValSetDef; return $oValSetDef;
} }
public function RemoveLoaded()
{
$oValSetDef = $this->Get("allowed_values");
if ($oValSetDef) {
$oValSetDef->RemoveLoaded();
}
}
public function GetAllowedValues($aArgs = [], $sContains = '') public function GetAllowedValues($aArgs = [], $sContains = '')
{ {
//throw new Exception("GetAllowedValues on ext key has been deprecated"); //throw new Exception("GetAllowedValues on ext key has been deprecated");