From 40ec7e35fdefa01ca97458cf22ae3191914c5bbf Mon Sep 17 00:00:00 2001 From: acognet Date: Wed, 22 Sep 2021 12:00:26 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B04245=20-=20Using=20customfield=20in=20no?= =?UTF-8?q?tifications=20triggered=20by=20TriggerOnObjectUpdate=20via=20Ap?= =?UTF-8?q?plyStimulus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/attributedef.class.inc.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 60dd920ff5..e826fb1f2c 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -12545,17 +12545,12 @@ class AttributeCustomFields extends AttributeDefinition */ public function ReadValueFromPostedForm($oHostObject, $sFormPrefix) { - $sData=utils::ReadPostedParam("attr_{$sFormPrefix}{$this->GetCode()}", '{}', 'raw_data'); - if($sData == null){ + $aRawData = json_decode(utils::ReadPostedParam("attr_{$sFormPrefix}{$this->GetCode()}", '{}', 'raw_data'), true); + if ($aRawData != null) { + return new ormCustomFieldsValue($oHostObject, $this->GetCode(), $aRawData); + } else{ return null; } - $aRawData = json_decode($sData,true); - - if ($aRawData == null) { - // Temporarly commented as it is blocking for several people. Will be looked / fixed by ACC in the coming days. - // throw new Exception('Unable to decode parameter attr_'.$sFormPrefix.$this->GetCode().': '.$sData); - } - return new ormCustomFieldsValue($oHostObject, $this->GetCode(), $aRawData); } public function MakeRealValue($proposedValue, $oHostObject)