- Issue created by @murz
- First commit to issue fork.
- @immaculatexavier opened merge request.
- 🇮🇳India immaculatexavier
Through issue fork, I worked in accordance with the proposed resolution. Please review
https://git.drupalcode.org/issue/drupal-3293550/-/commit/50e4334e4af9289...
- 🇦🇲Armenia murz Yerevan, Armenia
@immaculatexavier Thank you for the quick fix for it, but seems there is a problem with it, because I see to much changes in the diff:
https://git.drupalcode.org/project/drupal/-/merge_requests/2453/diffs
828 files +10413 -6681 - @murz opened merge request.
- 🇦🇲Armenia murz Yerevan, Armenia
We already have a
@todo
int the code to cast all integers to string:// @todo For Drupal 8, cast all integer keys to strings for consistency // with \Drupal\Core\Render\Element\Radios::processRadios().
So this should fix the described problem, let's go via this way!
if (is_int($key)) { $key = strval($key); }
I've created a new branch with this fix https://git.drupalcode.org/issue/drupal-3293550/-/compare/9.4.x...329355... - please review.
- 🇦🇲Armenia murz Yerevan, Armenia
Attaching a static patch file with those changes, to make it possible to use in composer until 🐛 GitLab Merge Requests Unable to Generate Incremental Patch Files Active is resolved.
- 🇦🇲Armenia murz Yerevan, Armenia
Attaching a static patch file with those changes, to make it possible to use in composer until 🐛 GitLab Merge Requests Unable to Generate Incremental Patch Files Active is resolved.
- 🇺🇸United States smustgrave
Thank you for the patch and clear issue summary. For bugs it's best to also include a test case to cover what you are fixing to avoid it appearing again.
Upload a tests-only patch which should fail.
Then a full path with your change and the test which should pass.This shows a good test case
- 🇺🇸United States smustgrave
Also tested the patch and it doesn't appear to be working. The tag isn't saving the default when disabled.
- 🇮🇳India ameymudras
The issue seems to be else where. I tried testing the same and it looks to like the default value is getting saved only if an input is provided for e.g:
If you have 2 checkboxes and if you save the form without selecting any other checkbox then the default value is not saved
If you select any other checkbox and try to save the form the default value gets saved.
- 🇺🇸United States smustgrave
So the issue being described here actually was fixed in https://www.drupal.org/project/drupal/issues/3293609 🐛 Form element "checkboxes" with "required" fails validation if all selected options are disabled Needs work for me. I agree with the change in this ticket too so should we consolidate the 2?
Drupal 9.4.9 → was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule → and the Allowed changes during the Drupal core release cycle → .
- 🇺🇸United States smustgrave
Updated the issue summary and title to match the patch.
The original issue is fixed in https://www.drupal.org/project/drupal/issues/3293609 🐛 Form element "checkboxes" with "required" fails validation if all selected options are disabled Needs work for me.
I searched core repo for "cast all integer keys" and this was the only instance.
Patch in #12 still cleanly applies.
If anyone disagrees please comment!
Thanks!
- 🇺🇦Ukraine ipinchuk
Hi all,
@Murz, thank you for your patch. I checked it. And looks like it doesn't fix the issue described in the previous summary (Original Post by Murz).
Fully agree with @smustgrave.
I think this is good to be marked as RTBC
Thanks
The last submitted patch, 12: drupal-defaults-for-disabled-checkboxes-3293550-12.patch, failed testing. View results →
- Status changed to Needs work
12 months ago 6:29pm 30 December 2023