Hi.
When creating a new field ("integer", "single on/off checkbox") I get an error (see screenshot) because the default value of the checkboxes is not set correct (it is set to '' but expects an array).
This is due to the fact you're using isset instead of !empty.
accepted_limits.module
<?php
$form['accepted_limits']['accepted_limit_display'] = array(
'#type' => 'checkboxes',
'#title' => t('Message display'),
'#description' => t('Specify when to display the warning messages.'),
'#default_value' => isset($field['accepted_limit_display']) ? $field['accepted_limit_display'] : array('submit', 'edit'),
'#options' => array(
'submit' => t('When submitting'),
'edit' => t('When editing'),
),
?>
If you change this to
<?php
'#default_value' => !empty($field['accepted_limit_display']) ? $field['accepted_limit_display'] : array('submit', 'edit'),
?>
the module works without the error message.
Unfortunately I can't create a patch at the moment so you need to fix this by hand (or I upload a patch later today :) ).
Thanks,
Stefan
Comments
Comment #1
stborchertHere is the patch.
Comment #2
vkareh commentedCommitted to the new development snapshot! Thanks!!