The custom icon_selector
field type is trying to use fieldset as the form's wrapper.
/**
* Implements hook_element_info().
*/
function icon_element_info() {
$types['icon_selector'] = array(
'#input' => TRUE,
'#tree' => TRUE,
'#title' => t('Icon'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#default_bundle' => '',
'#default_icon' => '',
'#default_wrapper' => '',
'#default_wrapper_class' => '',
'#process' => array('form_process_fieldset', 'form_process_icon_selector'),
'#pre_render' => array('form_pre_render_fieldset'),
'#theme_wrappers' => array('fieldset'),
'#attached' => array('library' => array(array('icon', 'icon_selector'))),
);
return $types;
}
However, it triggers the warning: "Warning: Array to string conversion in theme_fieldset()
", when the form fails validation (e.g., required field empty). The reason for this is that the theme_fieldset()
function expects the #value
attribute to be a string. In this instance, it is:
Array
(
[icon] => lineawesome|archive-solid
[wrapper] =>
[wrapper_class] =>
)
Submit a form with the `Icon` field type and intentionally omit filling out any of the required fields on the form.
TBD
Needs review
1.0
Code