From ddc3de800b69c3dc1da4c7940567e71558c93536 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Mon, 25 Sep 2023 17:23:46 -0400 Subject: [PATCH] allow showing detailed error messages from AJAX --- CRM/Api4/Page/AJAX.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Api4/Page/AJAX.php b/CRM/Api4/Page/AJAX.php index dee72c6f70..bea9ec4822 100644 --- a/CRM/Api4/Page/AJAX.php +++ b/CRM/Api4/Page/AJAX.php @@ -137,7 +137,7 @@ class CRM_Api4_Page_AJAX extends CRM_Core_Page { $status = $statusMap[get_class($e)] ?? 500; // Send error code (but don't overwrite success code if there are multiple calls and one was successful) $this->httpResponseCode = $this->httpResponseCode ?: $status; - if (CRM_Core_Permission::check('view debug output')) { + if (CRM_Core_Permission::check('view debug output') || ($e->getErrorData()['show_detailed_error'] ?? FALSE)) { $response['error_code'] = $e->getCode(); $response['error_message'] = $e->getMessage(); if (!empty($params['debug'])) { -- 2.25.1