Fix hard-crash when afform fails to render
authorColeman Watts <coleman@civicrm.org>
Mon, 1 Feb 2021 02:42:48 +0000 (21:42 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 1 Feb 2021 02:42:48 +0000 (21:42 -0500)
ext/afform/core/Civi/Afform/AfformMetadataInjector.php

index cf9082a413ef6b1f69cc56335a8f69aae887f9b3..5d13b28ac7ab9d4eb84aef85cb08d6867d8d583c 100644 (file)
@@ -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'];
           }