N°1420 - Limit count

SVN:2.4[5838]
This commit is contained in:
Eric Espié
2018-06-08 09:24:25 +00:00
parent 6ca3ca108b
commit 3a34417a7d

View File

@@ -2568,7 +2568,7 @@ EOF
if ($oAttDef->IsExternalKey())
{
$oAllowedValues = MetaModel::GetAllowedValuesAsObjectSet($sClass, $sAttCode, $aArgs);
if ($oAllowedValues->Count() == 1)
if ($oAllowedValues->Count(2) == 1)
{
$oRemoteObj = $oAllowedValues->Fetch();
$oObj->Set($sAttCode, $oRemoteObj->GetKey());
@@ -2687,7 +2687,7 @@ EOF
if ($oAttDef->IsExternalKey())
{
$oAllowedValues = MetaModel::GetAllowedValuesAsObjectSet($sClass, $sAttCode, $aArgs, '', $this->Get($sAttCode));
if ($oAllowedValues->Count() == 1)
if ($oAllowedValues->Count(2) == 1)
{
$oRemoteObj = $oAllowedValues->Fetch();
$this->Set($sAttCode, $oRemoteObj->GetKey());