Field order not right

smooshy - February 4, 2009 - 23:22
Project:Addresses
Version:6.x-1.05
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The default field order for the address fields was showing up incorrectly (or at least didn't look like it should for normal addresses). Went into the addresses config -> field order section and noticed that all of the fields had a weight of -10. I dragged one and they all fell into place correctly with -10, -9, -8, etc. After I saved the configuration it shows up correctly in the edit form.

It seems like the default sort order is not set correctly.

#1

brmassa - February 11, 2009 - 09:05

Stan,

the default values consider all fields as having 0 in weight by default. however, i dont know how could i fix this problem, considering better values.

im open for suggestions.

regards,

massa

#2

butler360 - February 13, 2009 - 19:16

The same happens with me but also if I change the field order and save the fields reset to the default ones being enabled/disabled instead of the ones I chose to enable or disable. This is with the "Extras" module so I'm not sure if that's affecting it.

#3

zedzed - March 24, 2009 - 17:35

If i change fields order in addresses settings page, then i save it. Fields order table isn't reordered correctly.
I look the code and in file addresses.settings.inc, function _addresses_settings
On line 267, if i change

$form['addresses_field_weight'][$field_code] = array(
      '#tree'           => TRUE,
     );

to
$form['addresses_field_weight'][$field_code] = array(
      '#tree'           => TRUE,
     '#weight'         => empty($field_weights[$field_code]['weight']) ? 0 : $field_weights[$field_code]['weight'],
    );

all it's ok ...

#4

adam_b - August 7, 2009 - 22:05

I tried adding this line, and now the field order appears correctly in the Addresses config - but it's still wrong in the node display.

 
 

Drupal is a registered trademark of Dries Buytaert.