Closed (fixed)
Project:
Mailchimp
Version:
6.x-2.4
Component:
General
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2011 at 16:41 UTC
Updated:
26 Sep 2011 at 19:39 UTC
Jump to comment: Most recent file
Comments
Comment #1
levelos commentedhttp://drupal.org/commitlog/commit/5104/6b1393a4aa177e54d00c7fb91a2ee2e2...
Comment #2
kanani commentedSo changing hook_user to fire on 'after_update' causes an issue when a user is trying to change their email address.
On 'update' the old email address is preserved in $account->mail and the new email is stored in $edit['mail'] so that listUpdateMember is called, mailchimp has a valid key to work against to pass in the new email in the merge_vars.
If hook_user is fired on 'after_update', $account->mail and $edit['mail'] both contain the new email so instead of the old getting set to new, a new subscriber is added to the list in mailchimp, and the old one is retained.
In addition to having the user subscribed twice (albeit with different email addresses), this makes it impossible to delete the original email from mailchimp through Drupal because any calls to listUnsubscribe will use the old email as a key.
Maybe a workaround to this would be to have fire hook_user on 'update' but only let it update mail, then the rest of the updates can occur on 'after_update'?
Comment #3
kanani commentedComment #4
kanani commentedPatch to check email on update, everything else on after_update. Also make sense to revisit whether this should fire on $op == 'update'
Comment #5
kanani commentedPrevious patch didn't include 'update' check in if in_array check.
Comment #6
bleedev commentedCommitted change to pass updated email to to use in 'after_update'.