Project:Addresses
Version:6.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

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

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

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

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.

#5

Is this still an issue with the dev version? From a fresh install I see only 'Primary Address Checkbox', 'Address Name', and 'Country' with weights of -10. All other fields have individual weights. From my poking around it appears as thought these fields appear in the order shown across the system.

adam_b - Display order within node display is handled by the country formatting in the Addresses configuration screen. Thus if you want to change the order for display within the node you will need to update it within that configuration screen, per country that you want modified.

#6

Version:6.x-1.05» 6.x-1.x-dev
Status:active» postponed (maintainer needs more info)

#7

Status:postponed (maintainer needs more info)» needs work

Just tried this again from a fresh install and received varied results.

zedzed's change fixes the display of the order of fields, once ordered, and has thus been committed as it fixes part of the functionality.

Going from HEAD we now need to ensure that the field weight is adhered to within addresses_user.

Another nice update would be to provide default weights for the fields upon a fresh install.

#8

Status:needs work» fixed

After checking through the system it appears as though the field order matches the specified order globally.

Marking as fixed.

For default order of country, primary, and address name see #685018: Provide default field weights for primary, name, country.

#9

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here