Closed (fixed)
Project:
CivicTheme Design System
Version:
1.10.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
23 Dec 2024 at 04:24 UTC
Updated:
21 Apr 2025 at 00:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dhruv.mittal commentedWorking on it
Comment #3
richardgaunt commentedHi @dhruv.mittal,
Pull requests for this project are done on this repository via GitHub: https://github.com/civictheme/monorepo-drupal
There are three parts to this solution:
Update the civictheme_preprocess_fieldset__form_element__civictheme_field__checkboxes and civictheme_preprocess_fieldset__form_element__civictheme_field__radios
In `civictheme_preprocess_fieldset__form_element__civictheme_field__checkboxes`:
We need to change this line:
https://github.com/civictheme/monorepo-drupal/blob/develop/web/themes/co...
And
https://github.com/civictheme/monorepo-drupal/blob/develop/web/themes/co...
to check for `#value` rather than `#default_value`
Update the checkbox preprocessing
We need to change the checkbox preprocessing at: https://github.com/civictheme/monorepo-drupal/blob/develop/web/themes/co... to something like this
Add some behat tests
We need to add some tests ensuring that in error forms retain their values for checkboxes and radios
Comment #5
dhruv.mittal commentedHI @richardgaunt,
I have done the all the suggested changes.
But I don't know about behat tests, I would love to help if you guide me about them.
Comment #6
richardgaunt commented@dhruv.mittal Could you create the PR from a forked https://github.com/civictheme/monorepo-drupal this way I can review and merge there. Changes from github get pushed up to this repository.
I can review and have behat tests added there.
Comment #7
dhruv.mittal commentedI have created the pr for the same please review
https://github.com/civictheme/monorepo-drupal/pull/1319
Comment #8
richardgaunt commentedComment #10
dhruv.mittal commented@richardgaunt thanks for merging the MR, could you please change the issue status to "FIXED".
Comment #11
fionamorrison23 commented@dhruv.mittal we will update the status after this work has been tested. Thanks for your contribution.
Comment #12
fionamorrison23 commentedComment #13
fionamorrison23 commentedComment #15
fionamorrison23 commentedComment #16
danielgry commentedVerified and tested on 1.x-dev
Testing Results:
1. Checkboxes and radio inputs retain their selected state after form validation errors
2. Inspected the checkbox input and confirmed the checked attribute is correctly present before data-drupal-selector
Screenshot:

Comment #17
danielgry commentedAdding screenshot as part of comment above:

Comment #18
danielgry commentedComment #19
danielgry commentedComment #20
fionamorrison23 commentedComment #21
richardgaunt commentedComment #22
fionamorrison23 commentedComment #23
fionamorrison23 commented