- Issue created by @thomasdegraaff
Please add to the issue summary your code implementation that triggers this bug.
- π³π±Netherlands thomasdegraaff
Update: The issue is not resolved by adding
if (!isset($element['#default_value']) || $element['#default_value'] == 0) { $element['#default_value'] = []; }
Because then the checkboxes are not show in the webform when you accept the defaults without changing anything. They do appear though when you manually change a default option. Then all default options are shown.
- πΊπΈUnited States jrockowitz Brooklyn, NY
We can't debug custom code, but conceptually, I understand the checkboxes default value should be an array and not an empty string.
The attached patch might fix your issue, you could change #default_value when you extend the WebformCheckboxes plugin.
- Status changed to Needs review
10 months ago 5:53pm 23 November 2024 - Merge request !558Issue #3473496: processCheckboxes: count(): Argument #1 ($value) must be of... β (Open) created by jrockowitz
- Status changed to RTBC
26 days ago 1:44am 24 August 2025 - πΊπΈUnited States jrockowitz Brooklyn, NY
If MR tests passes this should be merged since it is very simple code improvement checkboxes.
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
liam morland β made their first commit to this issueβs fork.
- πΊπΈUnited States jrockowitz Brooklyn, NY
The failing tests is indicating that this is not an easy fix.