Merge pull request #17937 from seamuslee001/radio_jquery_require
[civicrm-core.git] / CRM / UF / Page / ProfileEditor.php
index 466278a3fa460bd9860a9363fb660cb353f680d5..061b7ce742bc9082e922f67ce3c2d33bf5e6eeee 100644 (file)
@@ -192,7 +192,20 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
           break;
 
         default:
-          throw new CRM_Core_Exception("Unrecognized entity type: $entityType");
+          if (strpos($entityType, 'Model') !== FALSE) {
+            $entity = str_replace('Model', '', $entityType);
+            $backboneModel = self::convertCiviModelToBackboneModel(
+              $entity,
+              ts('%1', [1 => $entity]),
+              $availableFields
+            );
+            if (!empty($backboneModel['schema'])) {
+              $civiSchema[$entityType] = $backboneModel;
+            }
+          }
+          if (!isset($civiSchema[$entityType])) {
+            throw new CRM_Core_Exception("Unrecognized entity type: $entityType");
+          }
       }
     }