mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Fix AttributeSet wrong error on number of tags in creation
This commit is contained in:
@@ -3370,7 +3370,7 @@ EOF
|
||||
$oSet = $this->Get($sAttCode);
|
||||
if (is_null($oSet))
|
||||
{
|
||||
$oSet = new ormSet(get_class($this), $sAttCode);
|
||||
$oSet = new ormSet(get_class($this), $sAttCode, $oAttDef->GetMaxItems());
|
||||
}
|
||||
$oSet->ApplyDelta($value);
|
||||
$this->Set($sAttCode, $oSet);
|
||||
@@ -3427,7 +3427,14 @@ EOF
|
||||
{
|
||||
$aFinalValues[$sAttCode] = $aValues[$sAttCode];
|
||||
}
|
||||
$this->UpdateObjectFromArray($aFinalValues);
|
||||
try
|
||||
{
|
||||
$this->UpdateObjectFromArray($aFinalValues);
|
||||
}
|
||||
catch (CoreException $e)
|
||||
{
|
||||
$aErrors[] = $e->getMessage();
|
||||
}
|
||||
if (!$this->IsNew()) // for new objects this is performed in DBInsertNoReload()
|
||||
{
|
||||
InlineImage::FinalizeInlineImages($this);
|
||||
@@ -3660,8 +3667,14 @@ EOF
|
||||
$aFinalValues[$sAttCode] = $aValues[$sAttCode];
|
||||
}
|
||||
}
|
||||
$this->UpdateObjectFromArray($aFinalValues);
|
||||
|
||||
try
|
||||
{
|
||||
$this->UpdateObjectFromArray($aFinalValues);
|
||||
}
|
||||
catch (CoreException $e)
|
||||
{
|
||||
$aErrors[] = $e->getMessage();
|
||||
}
|
||||
return $aErrors;
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ class WizardHelper
|
||||
else if ($oAttDef instanceof AttributeSet) // AttributeDate is derived from AttributeDateTime
|
||||
{
|
||||
$value = json_decode($value, true);
|
||||
$oTagSet = new ormSet(get_class($oObj), $sAttCode);
|
||||
$oTagSet = new ormSet(get_class($oObj), $sAttCode, $oAttDef->GetMaxItems());
|
||||
$oTagSet->SetValues($value['orig_value']);
|
||||
$oTagSet->ApplyDelta($value);
|
||||
$oObj->Set($sAttCode, $oTagSet);
|
||||
|
||||
Reference in New Issue
Block a user