From 14b6e903cba6f348d434f4c679dbd27317e91034 Mon Sep 17 00:00:00 2001 From: acognet Date: Tue, 14 Sep 2021 09:40:45 +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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index c8b9e3427..f80b2ec64 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -12545,9 +12545,15 @@ class AttributeCustomFields extends AttributeDefinition */ public function ReadValueFromPostedForm($oHostObject, $sFormPrefix) { - $aRawData = json_decode(utils::ReadPostedParam("attr_{$sFormPrefix}{$this->GetCode()}", '{}', 'raw_data'), - true); + $sData=utils::ReadPostedParam("attr_{$sFormPrefix}{$this->GetCode()}", '{}', 'raw_data'); + if($sData == null){ + return null; + } + $aRawData = json_decode($sData,true); + if ($aRawData == null) { + throw new Exception('Unable to decode parameter attr_'.$sFormPrefix.$this->GetCode().': '.$sData); + } return new ormCustomFieldsValue($oHostObject, $this->GetCode(), $aRawData); }