Removed required field validation

This commit is contained in:
CiviWare Solutions 2018-08-24 02:39:16 +05:30
parent 4f7d91a5cc
commit 7b97bd7839
2 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,7 @@ class CRM_EntityTemplates_Utils {
public static function buildForm($formName, &$form) { public static function buildForm($formName, &$form) {
if (!empty($form->_entityTemplateValues)) { if (!empty($form->_entityTemplateValues)) {
if ($form->_entityTemplate) { if ($form->_entityTemplate) {
unset($form->_required);
$form->add('hidden', 'entity_template', $form->_entityTemplate); $form->add('hidden', 'entity_template', $form->_entityTemplate);
if ($form->_entityTemplateId) { if ($form->_entityTemplateId) {
$form->add('hidden', 'entity_template_id', $form->_entityTemplateId); $form->add('hidden', 'entity_template_id', $form->_entityTemplateId);

View File

@ -259,5 +259,13 @@ function entitytemplates_civicrm_validateForm($formName, &$fields, &$files, &$fo
$errors['entity_template_title'] = ts('Title already exists.'); $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);
}
} }
} }