With Ubercart Addresses 6.x-2.x enabled, when you create a textfield with a default value with Extra Fields Pane, this default value keeps showing up on every address form, overwriting any saved values.
This happens for example:

  • In the address book (when editing an address).
  • When editing an order.
  • When going back to the checkout page coming from the checkout review page.

This is because in the code, the field saved value is only set when there is no default value (± line 80 of includes/uc_addresses.handlers.inc):

$field[$fieldName] += array(
  '#default_value' => $default,
);

The Drupal 7 version of Extra Fields Pane is also affected.

A fix will be committed shortly for both 6.x-2.x and 7.x-1.x.

Comments

megachriz’s picture

Status: Active » Fixed

Fixes for both branches are committed:

megachriz’s picture

Status: Fixed » Needs work

Oops, forgot to run automated tests for these fixes. One of the tests in 7.x-1.x is now broken. I'm working on a "fixed" fix. ;)

megachriz’s picture

Status: Needs work » Fixed

Fixes are committed for both 6.x-2.x and 7.x-1.x:

An additional fix was added for the 6.x-2.x branch: when creating an order, extra fields with a specified default value were NOT getting a default value on the order edit page. Also, the constant and php string fields were left empty. They now contain a default value when creating the order. I've tested that these fields will not overwrite values of existing orders. Installations that have Ubercart Addresses 6.x-2.x enabled, were not affected by this bug.

Status: Fixed » Closed (fixed)

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