Closed (works as designed)
Project:
Drupal core
Version:
6.2
Component:
forms system
Priority:
Normal
Category:
Bug report
Reporter:
Anonymous (not verified)
Created:
17 May 2008 at 09:15 UTC
Updated:
1 May 2021 at 09:21 UTC
In a hook_user of my module I wrote
$form['picture'] = array('#weight' => 10);
to bring the picture fieldset to the bottom of the form. But it's to much to the bottom, it is UNDER the Save button. This also happens to other fieldsets if I try to overwrite their weight.
Already tried out to find the reason, but only could find the function weight_value() in form.inc, which isn't called from anywhere.
Comments
Comment #1
blakehall commentedThe 'form' op of hook_user is for _injecting_ form elements into the form rather than modifying them. Trying to use hook_user to do this, alters the form array to look like:
$form['picture']['#weight'] = array( 0 => 10, 1 => 1);Your module could use hook_form_alter to reset the weight of the picture element like:
(The weight on the submit button is 30, by default).
Hope this helps.