diff --git a/CRM/EntityTemplates/Utils.php b/CRM/EntityTemplates/Utils.php index 7ca844a..f9912e3 100644 --- a/CRM/EntityTemplates/Utils.php +++ b/CRM/EntityTemplates/Utils.php @@ -37,6 +37,7 @@ class CRM_EntityTemplates_Utils { public static function buildForm($formName, &$form) { if (!empty($form->_entityTemplateValues)) { if ($form->_entityTemplate) { + unset($form->_required); $form->add('hidden', 'entity_template', $form->_entityTemplate); if ($form->_entityTemplateId) { $form->add('hidden', 'entity_template_id', $form->_entityTemplateId); diff --git a/entitytemplates.php b/entitytemplates.php index 1c7bede..4e0fc50 100644 --- a/entitytemplates.php +++ b/entitytemplates.php @@ -259,5 +259,13 @@ function entitytemplates_civicrm_validateForm($formName, &$fields, &$files, &$fo $errors['entity_template_title'] = ts('Title already exists.'); } } + if ($formName == 'CRM_Contact_Form_Contact') { + $contactType = [ + ts('First Name and Last Name OR an email OR an OpenID in the Primary Location should be set.'), + ts('Organization Name should be set.'), + ts('Household Name should be set.'), + ]; + $form->_errors = array_diff($form->_errors, $contactType); + } } }