Closed (works as designed)
Project:
Ubercart
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Dec 2009 at 18:01 UTC
Updated:
4 Feb 2011 at 14:18 UTC
Hi,
i just want to change the form field #weight in my theme_preprocess_uc_cart_checkout_form();
something like
mytheme_preprocess_uc_cart_checkout_form($form){
$form['form']['panes']['delivery']['delivery_postal_code']['#weight'] = 50;
...
but thats not possible. After checking some code i add a default #weight to function uc_textfield in file uc_store.module
function uc_textfield($title, $default = NULL, $required = TRUE, $description = NULL, $maxlength = 32, $size = 32) {
if (is_null($title) || empty($title))
return NULL;
$textfield = array(
'#type' => 'textfield',
'#title' => $title,
'#description' => $description,
'#size' => $size,
'#maxlength' => $maxlength,
'#required' => $required,
'#default_value' => $default,
'#summary' => $default ? t('@title is %default.', array('@title' => $title, '%default' => $default))
: t('@title is not set.', array('@title' => $title)),
'#weight' => 0,
);
return $textfield;
}
and now it is possible to change the #weight too in my theme function
Comments
Comment #1
longwaveYou can still override #weight even if it wasn't set in the original definition.