Closed (fixed)
Project:
Taxonomy Manager
Version:
6.x-1.0-beta2
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Apr 2009 at 12:58 UTC
Updated:
21 May 2009 at 09:50 UTC
In the taxonomy_manager_form declaration there is a small "glitch" which makes it annoyingly hard to alter the form. I encountered the problem when trying to use hook_form_alter on the form, wanting to add a new toolbar button.
The #suffix =
should not be placed on the last button, but used in #prefix in the wrapper. If not, the last button is suddenly made into a "special case" button, which it is not. The wrapper is the one to hold such values.
This is how it is now:
$form['toolbar']['export_show'] = array(
'#type' => 'button',
'#attributes' => array('class' => 'taxonomy-manager-buttons export'),
'#value' => t('CSV Export'),
'#theme' => 'no_submit_button',
'#suffix' => '</div>'
);
$form['toolbar']['wrapper'] = array(
'#type' => 'markup',
'#value' => '<div id="taxonomy-manager-toolbar-throbber"></div><div class="clear"></div>',
'#weight' => 20,
);
This is how it should be:
$form['toolbar']['export_show'] = array(
'#type' => 'button',
'#attributes' => array('class' => 'taxonomy-manager-buttons export'),
'#value' => t('CSV Export'),
'#theme' => 'no_submit_button',
);
$form['toolbar']['wrapper'] = array(
'#type' => 'markup',
'#value' => '<div id="taxonomy-manager-toolbar-throbber"></div><div class="clear"></div>',
'#weight' => 20,
'#prefix' => '</div>'
);
Comments
Comment #1
mh86 commentedcommitted changes :)
thanks for your help