From: Coleman Watts Date: Mon, 21 Jul 2014 08:39:48 +0000 (+0100) Subject: Form_Renderer - ensure params is an array X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e6d37e5086ad1a66778921a37ae44a6350ab57db;p=civicrm-core.git Form_Renderer - ensure params is an array --- diff --git a/CRM/Core/Form/Renderer.php b/CRM/Core/Form/Renderer.php index 58273ad6a0..3a75049e67 100644 --- a/CRM/Core/Form/Renderer.php +++ b/CRM/Core/Form/Renderer.php @@ -216,7 +216,9 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { } if ($val) { $entity = $field->getAttribute('data-api-entity'); - $params = json_decode($field->getAttribute('data-api-params'), TRUE); + // Get api params, ensure it is an array + $params = $field->getAttribute('data-api-params'); + $params = $params ? json_decode($params, TRUE) : array(); // Support serialized values if (strpos($val, CRM_Core_DAO::VALUE_SEPARATOR) !== FALSE) { $val = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($val, CRM_Core_DAO::VALUE_SEPARATOR));