From 79004baa8f9cae27938b3164c72c7b66da77e259 Mon Sep 17 00:00:00 2001 From: Xavier Dutoit Date: Tue, 8 Oct 2013 08:47:02 +0100 Subject: [PATCH] CRM-13552 add a smarty error if there is a crm error in {crmAPI} --- CRM/Core/Smarty/plugins/function.crmAPI.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Core/Smarty/plugins/function.crmAPI.php b/CRM/Core/Smarty/plugins/function.crmAPI.php index 4de0bbf940..caa2aa751b 100644 --- a/CRM/Core/Smarty/plugins/function.crmAPI.php +++ b/CRM/Core/Smarty/plugins/function.crmAPI.php @@ -61,6 +61,10 @@ function smarty_function_crmAPI($params, &$smarty) { return; } + if (array_key_exists('is_error', $result) && $result['is_error']) { + $smarty->trigger_error("{crmAPI} ".$result["error_message"]); + } + if (!array_key_exists('var', $params)) { return json_encode($result); } -- 2.25.1