mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 18:18:46 +02:00
N°1827 fix freeze on object creation when changing dependant field, if object has hidden TagSet field
This commit is contained in:
@@ -176,7 +176,15 @@ class WizardHelper
|
||||
}
|
||||
else if ($oAttDef instanceof AttributeTagSet) // AttributeDate is derived from AttributeDateTime
|
||||
{
|
||||
$value = json_decode($value, true);
|
||||
if (is_null($value))
|
||||
{
|
||||
// happens if field is hidden (see N°1827)
|
||||
$value = array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = json_decode($value, true);
|
||||
}
|
||||
$oTagSet = new ormTagSet(get_class($oObj), $sAttCode, $oAttDef->GetMaxItems());
|
||||
$oTagSet->SetValues($value['orig_value']);
|
||||
$oTagSet->ApplyDelta($value);
|
||||
|
||||
@@ -49,6 +49,10 @@ final class ormTagSet extends ormSet
|
||||
*/
|
||||
public function SetValues($aTagCodes)
|
||||
{
|
||||
if (is_null($aTagCodes))
|
||||
{
|
||||
$aTagCodes = array();
|
||||
}
|
||||
if (!is_array($aTagCodes))
|
||||
{
|
||||
throw new CoreUnexpectedValue("Wrong value {$aTagCodes} for {$this->sClass}:{$this->sAttCode}");
|
||||
|
||||
Reference in New Issue
Block a user