Needs work
Project:
Conditional Fields
Version:
4.0.0-alpha5
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Nov 2024 at 13:29 UTC
Updated:
6 Apr 2026 at 14:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
maniesraj commentedProposed resolution
Comment #3
maniesraj commentedHere is the patch!
Comment #4
benstallings commentedClaude Code says:
This is a band-aid that silently swallows the real problem.
The else branch at line 167-168 is the fallback when $values_array is empty — it tries to use $options['values'] as a single key to look up a checkbox. If $options['values'] is an array here, it means the data is in an unexpected format. Wrapping it in if (!is_array(...)) just silently skips it, producing no state at all — the dependency would be ignored with no warning.
The better fix would be to understand why $options['values'] is sometimes an array in the AND case when $values_array is empty, and handle it properly (e.g. iterate over it the same way the if branch does). Also a minor style issue: missing space after if.
Verdict: Not merge-worthy. It masks a data handling bug rather than fixing it. The dependency would silently stop working for affected configurations.