I have been seeing the warning of Undefined index in tao_textarea() whenever a textarea form element in a module has something similar to the following:

['embedscript'] = array(
'#type' => 'textarea',
'#attributes' => array('id' => 'embed-content', 'name' => 'embed-content'),
'#title' => t('Embed Script'),
'#required' => FALSE,
'#value' => get_embed_script($data->nid),
'#cols' => 60,
'#rows' => 12,

Seems that tao_textarea() directly sets $element['#attributes']['name'] equal to $elements['#name'] which may not always be set since it is not part of fapi documentation. FAPI documentation does however mention using #attribute associative array. Hence I propose the following patch.



nicholas.alipaz’s picture

new782 bytes

patch attached.