XF 2.1 Manually triggering rebuildUserConnectedAccountCache?

SeToY

Well-known member
Hello there,

I'm currently in the process of moving over my users' connected accounts from a custom field (using their identifier before) to a connected account (which also uses the identifier as the provider_key).

I've copied over all values from the custom field and inserted them into xf_user_connected_account, however the connected account is not appearing in the "Extra" tab of the ACP (no key required, just the identifier).

Then I noticed that xf_user_profile has a cache of connected accounts which I assume is the culprit of the account not showing for that particular user. How can I trigger a manual rebuild of that column? I tried clearing the user cache via "rebuild caches", but that did not work.

Thanks!
 
There isn't anything built-in to rebuild that, so you would have to do it yourself.

To be honest, the easiest way to do that is probably just to edit src/Job/User.php and find:
PHP:
$user->Profile->rebuildUserFieldValuesCache();
And below it add:
PHP:
$this->app->repository('XF:ConnectedAccount')->rebuildUserConnectedAccountCache($user);

Then run the "Rebuild users" tool again.
 
Back
Top Bottom