Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I have a site where users/customers were being uploaded from an external source every five minutes. We found that if one of these users was logged in, they were unexpectedly logged out whenever the migration ran.
It looks like the problem is as described here: http://drupal.stackexchange.com/questions/40438/users-are-getting-sponta...
Comments
Comment #2
fonant CreditAttribution: fonant at Fonant Ltd commentedAs per the linked description, the code in user_save() that is logging the user out is as follows:
Hmmm... are we changing the password every import, perhaps?
Comment #3
fonant CreditAttribution: fonant at Fonant Ltd commentedFindings so far:
It doesn't seem possible to use Migrate methods to set the existing password hash before MigrateDestinationUser::import() calls user_save. This means the user_save() function call will log out the user referred to by $old_account.
I _think_ I have a workaround using hook_user_presave() in a custom module: