Problem/Motivation
- Checkbox widget field dependencies are not triggered in the required validation check (evaluateDependencies()).
- Sometimes $values is 0 for checkbox fields on validation ($evaluated_dependees)
Steps to reproduce
- Create a visible form level dependency for the required field (target field), and select a checkbox field as the control field.
- Set a condition like the screenshot attached.
- now show/hide will work, required state will not work
Proposed resolution
Added a new condition for checkbox fields in evaluateDependencies()
src/ConditionalFieldsFormHelper.php
Remaining tasks
If needed implement the same for other field widgets.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | form_checkbox_dependency_not_triggered_fix-3523122-1.patch | 1.37 KB | maniesraj |
| Screenshot from 2025-05-07 17-28-38.png | 81.79 KB | maniesraj |
Comments
Comment #2
maniesraj commentedHere is a patch for the checkbox widget fields!