As the Drupal Admin, I'm supposed to be able to go to a user's account and look at their data. That's the way it works for the other fields.

At this time, I see the Drupal Admin address whatever the user I look at.

Ooops... 8-)

It is late, but I probably will look into it tomorrow.

Thank you
Alexis Wilke

Comments

AlexisWilke’s picture

I have found the bug. You are using the global $user->uid which is wrong when an admin edits another user.

Instead, you need to use the $form['#uid'] value. Whether that's the cleanest way, maybe not, but that works in D6.

This needs to change in both, the Form generation and the Save function. I will post a patch later. It's a bit late in the night here already...

brmassa’s picture

Status: Active » Fixed

Alexis,

i think i fixed it. Take another look please.

regards,

massa

AlexisWilke’s picture

Massa,

You missed one spot, but you're really close. 8-)

Thank you for going ahead and fixing that without a patch!
Alexis

/**
 * Submit the address
 *
 * @ingroup form
 */
function _addresses_user_form_submit($form, &$form_state) {
  _addresses_user_address_save($form_state['values']['addresses'], $form['#uid'], 'user');
}
brmassa’s picture

Alexis,

thanks again. commited.

regards,

massa

Anonymous’s picture

Status: Fixed » Closed (fixed)

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