Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed multiple checkboxes mistakenly marked as required if a Field is marked as required. #1312

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web/themes/contrib/civictheme/includes/form_element.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexSkrypnyk If I am understanding you, you are saying you shouldn't compel a user to check all the checkboxes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m saying that currently all of the checkboxes are marked required if the field has required attribute. But that required attribute means “at least one checkbox” is required rather than “all checkboxes are required”. Of course, this is in the context of “checkboxes” element only.

'attributes' => $attributes,
'modifier_class' => $modifier_class,
];
Expand Down
Loading