Skip to content

Commit

Permalink
Enable ability to require tags in profiles
Browse files Browse the repository at this point in the history
Prior to this change, it was not possible to make tags required in a
profile.
  • Loading branch information
jmcclelland committed May 31, 2022
1 parent 2c7e217 commit 85f7d86
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CRM/Contact/Form/Edit/TagsAndGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ public static function buildQuickForm(

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');
}
}

// build tag widget
Expand Down

0 comments on commit 85f7d86

Please sign in to comment.