From: Coleman Watts Date: Mon, 1 Feb 2021 02:42:48 +0000 (-0500) Subject: Fix hard-crash when afform fails to render X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b94d0569ad8043d39625e61cd536eb023d5c145a;p=civicrm-core.git Fix hard-crash when afform fails to render --- 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']; }