Drupal: how can I avoid this form item being collapsed? -


i don't why not working. want avoid specific form item being collapsed.

this element want modify (after change code below):

 [taxonomy] => array         (             [tags] => array                 (                     [1] => array                         (                             [#type] => textfield                             [#title] => tags                             [#description] => comma-separated list of terms describing content. example: funny, bungee jumping, "company, inc.".                             [#required] => 0                             [#default_value] =>                              [#autocomplete_path] => taxonomy/autocomplete/1                             [#weight] => 0                             [#maxlength] => 1024                             [#collapsed] => 0                             [#collapsible] => 0                         )                      [#collapsed] => 0                     [#collapsible] => 0                 )              [#weight] => -3             [#tree] => 1             [#collapsed] => 0             [#collapsible] => 0 

this code in hook_form_alter (i'm sure form modified code):

 $form['taxonomy']['#collapsed'] = 0;  $form['taxonomy']['tags']['#collapsed'] = 0;  $form['taxonomy']['tags'][2]['#collapsed'] = 0;   $form['taxonomy']['#collapsible'] = 0;  $form['taxonomy']['tags']['#collapsible'] = 0;  $form['taxonomy']['tags'][3]['#collapsible'] = 0; 

but doesn't work. element collapsed. , i've refreshed caches alt text

http://dl.dropbox.com/u/72686/tagsform.txt

update2:

$form['taxonomy']['#required'] = true; $form['taxonomy']['tags']['#required'] = true; $form['taxonomy']['tags'][5]['#required'] = true; 

alt text

from array posted, looks try adjust form element before taxonomy module turned fieldset (note there no '#type' => 'fieldset' declaration in array). if take @ taxonomy_form_alter(), can see in hook_form_alter() implementation, taxonomy array in node gets 'converted' actual forms api elements.

so guess adjustments reside in hook_form_alter() implementation runs before of taxonomy module, declarations collapsed states overwritten taxonomy module after set them.

try adjust modules weight higher of taxonomy module , see if changes things. (be aware changing weight might effect other things module does, test after doing it!)


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -