Change record status: 
Introduced in branch: 
7.x-1.x
Introduced in version: 
7.x-1.0-rc1
Description: 

A hook called hook_uc_addresses_order_load() is added to react on addresses being attached to an order. Previously, when you defined extra address fields and you want to populate those fields on the order, you had to implement hook_uc_order(). Now that addresses can be attached outside of the order loading context by calling uc_addresses_order_attach_addresses(), this solution is no longer good enough as that would make it unpredictable if or when the order's extra address fields get populated.

So implement hook_uc_addresses_order_load() if you define extra address fields that need to be populated on $order->uc_addresses.

Before

/**
 * Implements hook_uc_order().
 */
function mymodule_uc_order($op, $order) {
  if ($op == 'load') {
    // Example: set a value for my custom added field (through hook_uc_addresses_fields()).
    if (isset($order->uc_addresses['shipping'])) {
      $order->uc_addresses['shipping']->setField('myfield', 'myvalue');
    }
    if (isset($order->uc_addresses['billing'])) {
      $order->uc_addresses['billing']->setField('myfield', 'myvalue');
    }
  }
}

After

/**
 * Implements hook_uc_addresses_order_load().
 */
function mymodule_uc_addresses_order_load($order) {
  // Example: set a value for my custom added field (through hook_uc_addresses_fields()).
  if (isset($order->uc_addresses['shipping'])) {
    $order->uc_addresses['shipping']->setField('myfield', 'myvalue');
  }
  if (isset($order->uc_addresses['billing'])) {
    $order->uc_addresses['billing']->setField('myfield', 'myvalue');
  }
}
Impacts: 
Module developers