Enabling Content Accessibility submodule and going to Home » Administration » Structure » Content types » Article » Manage fields I get a warning:

Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value() (line 2289 of G:\UniServerZ\www\drupal-7\includes\form.inc).

Disabling the modules the warning doen't appear anymore.

Comments

pietrocap’s picture

I've found the buggy code which generates the warning.
In subfolder modules/accessibility_content in file accessibility_content.modules for two times the default value of a checkbox is set as below:

'#default_value' => (isset($form['#instance']['accessibility_content'])) ? 
                                 $form['#instance']['accessibility_content'] :
                                 FALSE,

FALSE cause the warning because In the Drupal Forms API the '#default_value' for a 'checkbox' form element must be an array and FALSE is not an array. We should use array() instead.
I've made a patch.

pietrocap’s picture

Status: Active » Needs review
Anonymous’s picture

Status: Needs review » Closed (fixed)

Fixed default value for checkboxes, but a checkbox (singular) does work with FALSE. Committed your patch other than that. Thanks.