From b94d0569ad8043d39625e61cd536eb023d5c145a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 31 Jan 2021 21:42:48 -0500 Subject: [PATCH] Fix hard-crash when afform fails to render --- ext/afform/core/Civi/Afform/AfformMetadataInjector.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/afform/core/Civi/Afform/AfformMetadataInjector.php b/ext/afform/core/Civi/Afform/AfformMetadataInjector.php index cf9082a413..5d13b28ac7 100644 --- a/ext/afform/core/Civi/Afform/AfformMetadataInjector.php +++ b/ext/afform/core/Civi/Afform/AfformMetadataInjector.php @@ -60,7 +60,8 @@ class AfformMetadataInjector { else { $entityName = pq($fieldset)->attr('af-fieldset'); if (!preg_match(';^[a-zA-Z0-9\_\-\. ]+$;', $entityName)) { - throw new \CRM_Core_Exception("Cannot process $path: malformed entity name ($entityName)"); + \Civi::log()->error("Afform error: cannot process $path: malformed entity name ($entityName)"); + return; } $entityType = $entities[$entityName]['type']; } -- 2.25.1