Massa,

In the code below, you use a variable named $type. It is a local variable that is never set. I suggest you either remove it or fix the code... I'm not too sure what you had in mind, so I cannot just remove it.

Thank you.
Alexis Wilke

function _addresses_user_address_get($id) {
  static $addresses;

  if (empty($addresses[$type][$id])) {
    $adr = db_query("SELECT * FROM {addresses_user}
      WHERE eid = %d
      ORDER BY is_primary DESC", $id);

    // Transform all SQL findings into arrays
    $addresses[$type][$id] = array();
    while ($address = db_fetch_array($adr)) {
      $addresses[$type][$id][] = $address;
    }
  }

  return $addresses[$type][$id];
}

Comments

brmassa’s picture

Status: Active » Fixed

Alexis,

originally, i was thinking about to record both CCK/node and user addresses using the same table. thats the reason about $type ('user', 'node'). But when i found a solution for CCK storage (its a tricky problem), the table was moved to user module because it was the only one to use it.

removed.

regards,

massa

AlexisWilke’s picture

Defaults would be cool. Especially for my customers who primarily work with local people and could set the default city & state!

Alexis

Anonymous’s picture

Status: Fixed » Closed (fixed)

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