Removed required field validation
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user