Denormalized username fields might be set incorrectly on imports

Kirby

Well-known member
Affected version
2.3.6
Throughout the importer code (XFI, XFMG, etc.) there are many places where denorrmalized usernames are set like this:

Example: Conversation message import from vBulletin
PHP:
$import->set('username', $message['fromusername'], [EntityEmulator::UNHTML_ENTITIES => true]);

This sets the username from source system data but the XenForo username might be different, for example if accounts have been merged or a rename due to a conflict was necessary.

Suggested Fix
If the username is changed when importing a user record this change in to import log.
After the import has finished run UserRenameCleanUp jobs for the affected accounts to update denormalized data before running the other finalize jobs.
 
Back
Top Bottom