logintoboggan calls hook_user_update and does not supply $edit['original']. Additionally other 3rd party login or user save systems might also not supply this value.

Drupal Commerce should test for it's existence of $edit['original'] before it chooses to act on it.

Sample patch as proof of concept. Not sure if you'd prefer not to act, should it not exist.

CommentFileSizeAuthor
commerce-cart-no-edit-original.patch600 bytesj0rd

Comments

rszrama’s picture

From walkah's comment at https://api.drupal.org/comment/23088#comment-23088, it looks like instead we can depend on $account->original. Is that present in modules like logintoboggan?

j0rd’s picture

The point of the function I believe is to update the email addresses in orders should the user change their email address.

With that said, if $edit['original'] is not available, then I assume you can assume, we're not updating the email address of the user and thus perhaps should not call the code.

So my patch would work with a && instead of a ||

..
if(!empty($edit['original']) && $account->mail != $edit['original']->mail) {
  // ... do the stuff
}
..
rszrama’s picture

Status: Needs review » Fixed

I like your logic, j0rd. Committing the revised approach from #2.

Commit: http://drupalcode.org/project/commerce.git/commitdiff/8d43c4c

Status: Fixed » Closed (fixed)

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

Exploratus’s picture

Thanks! Solved my issue!