From 7be2e5b65924c9bed176364765a605b48903a66c Mon Sep 17 00:00:00 2001 From: Tyrell Cook Date: Wed, 30 Apr 2014 19:10:19 -0400 Subject: [PATCH] CRM-14466 make sure element is initalized if empty to avoid php notice --- CRM/Utils/JSON.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/JSON.php b/CRM/Utils/JSON.php index 6e78112b05..098496b558 100644 --- a/CRM/Utils/JSON.php +++ b/CRM/Utils/JSON.php @@ -126,7 +126,10 @@ class CRM_Utils_JSON { if ($addcomma) { $sOutput .= ","; } - + //CRM-14466 --Make sure $value[$element] is defined to avoid php notice + if(!array_key_exists($element, $value)){ + $value[$element] = ""; + } //CRM-7130 --lets addslashes to only double quotes, //since we are using it to quote the field value. //str_replace helps to provide a break for new-line -- 2.25.1