Active
Project:
Tao
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2013 at 17:55 UTC
Updated:
2 Apr 2013 at 17:58 UTC
Jump to comment: Most recent file
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:
$form['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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | undefined_index_tao_textarea-1959206-1.patch | 782 bytes | nicholas.alipaz |
Comments
Comment #1
nicholas.alipaz commentedpatch attached.