XF 2.0 Change ID of connected account provider

Lukas W.

Well-known member
I'm still working on changing the ID of my connected account provider services, but after some issues in the past, that I'm still not sure if I've managed to resolve by simply brute-forcing a database update by doing the modification in four different ways, I'm now facing a new problem.

I've went to the database and changed all of my records to match the new ID in both, the xf_connected_account_provider and xf_user_connected_account tables to match the new ID (let's say from 'service' to 'kl_service'). I've also renamed the public template to connected_account_associated_kl_service and the admin template to connected_account_provider_kl_service. However, and that is the strange part, if I now head to account/connected-accounts, none of the already registered accounts seem to be noticed by the system anymore. Instead of the more or less empty connected_account_associated_kl_service template, I am shown the "Associate with Service" button. If I click it, the auth mechanism runs through fine, but throws an error when returning to my XF installation, that This account is already associated with another member. [...]. As there's only two accounts on my local installation and both are seemingly not connected, that's a bit confusing. The database entry still clearly links the user with the ID 1 (me), with the account provider kl_service, which is also the only entry in that table. Is there a third entry in the database that needs to be altered to reflect these changes and resolve this issue? Or some kind of caching mechanism?

Any help is gladly appreciated.
 
I've just noticed that if I delete one of the connected account entries in the database and reconnect that specific account (which then runs through without trouble), all other accounts reappear. I'm quite certain now that it is a caching issue, but none of the cache rebuild mechanisms in the ACP seem to have resolved it before.
 
xf_user_profile has a cached set of connected providers for users in the connected_accounts field.

That field will need to be rebuilt and there's a dedicated function for it called rebuildUserConnectedAccountCache in the ConnectedAccount repository.
 
Top Bottom