I have a single migration out of a larger group, that needs to be run as the administrator or an entity reference fails to map the User entity properly. I'd love ideas on what I might change so that I wouldn't have to be an administrator to entity reference users, but failing that:
How can I check what user the migration is currently running as? Basically I want to be sure that drush has been invoked with --user=1 or throw an exception with a reminder that this migration needs to be run as administrator.
$GLOBALS['user']->uidshould be avilable$GLOBALS['user']->previousid = $GLOBALS['user']->uid; $GLOBALS['user']->uid = 1;and this in postImport:$GLOBALS['user']->uid = $GLOBALS['user']->previousid;