From 7f08556f9624dc9c4960cb3a81f665176b9a2618 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 22 Oct 2024 23:05:00 +1100 Subject: [PATCH] Fixed multiple checkboxes mistakenly marked as required if a Field is marked as required. (#1312) Co-authored-by: richardgaunt <57734756+richardgaunt@users.noreply.github.com> --- web/themes/contrib/civictheme/includes/form_element.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/themes/contrib/civictheme/includes/form_element.inc b/web/themes/contrib/civictheme/includes/form_element.inc index 159e9ef2d..e39cf88fb 100644 --- a/web/themes/contrib/civictheme/includes/form_element.inc +++ b/web/themes/contrib/civictheme/includes/form_element.inc @@ -191,6 +191,8 @@ function civictheme_preprocess_fieldset__form_element__civictheme_field__checkbo 'id' => Html::cleanCssIdentifier($element['#id'] . '-' . $value), 'is_checked' => is_array($element['#default_value']) ? in_array($value, $element['#default_value']) : $element['#default_value'] == $value, 'is_disabled' => isset($element['#attributes']['disabled']), + // Checkboxes controls with a group cannot be required by definition. + 'is_required' => FALSE, 'attributes' => $attributes, 'modifier_class' => $modifier_class, ];