Skip to content

Commit

Permalink
simplify addition of required param.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcclelland committed Jun 8, 2022
1 parent 85f7d86 commit c51c929
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions CRM/Contact/Form/Edit/TagsAndGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ public static function buildQuickForm(
$tags = CRM_Core_BAO_Tag::getColorTags('civicrm_contact');

if (!empty($tags)) {
$form->add('select2', 'tag', ts('Tag(s)'), $tags, FALSE, ['class' => 'huge', 'placeholder' => ts('- select -'), 'multiple' => TRUE]);
if ($isRequired) {
$form->addRule('tag', ts('Tag is a required field.'), 'required');
$form->add('select2', 'tag', ts('Tag(s)'), $tags, $isRequired, ['class' => 'huge', 'placeholder' => ts('- select -'), 'multiple' => TRUE]);
}
}

Expand Down

0 comments on commit c51c929

Please sign in to comment.