Not a bug Old user upgrades showing incorrectly

Russ

Well-known member
Affected version
2.1.2
We used user upgrades like 4-5 years ago but have since deleted all of them.

Screenshot_1.png

When creating an upgrade, it'll start showing up random old expired upgrades and it shows they had the brand new upgrade that I just created.

Screenshot_2.png


Depending on the type of upgrade, permanent / recurring, it'll show different expired upgrades. The screenshot above is permanent. Deleted that and created a recurring, shows:

Screenshot_3.png
 
Last edited:
Pretty sure that, a while ago, we made it so that active/expired records which do not have a corresponding user upgrade are no longer visible.

What this report implies, then, is that the new user upgrades you have created somehow have the same user upgrade record ID as the old active/expired records.

That might happen, for example, if the user upgrades table was at some point truncated. If that happens, the auto-increment index is reset to 0. That means if you create a new user upgrade, it will be given ID 1, which may have existed previously, which may have a bunch of corresponding active/expired records.

Is it possible anything like that happened?

Can you verify the user_upgrade_id of these user upgrades you have created? If they are unusually low (say if you had X number of user upgrades before) then that might explain it.
 
The current user_upgrade_id on that "test" is 6.

I dropped the entries from xf_user_upgrade_active and xf_user_upgrade_expired (from 5 years ago) for now.

I have a copy of the DB and on the xf_user_upgrade_active I'm seeing
Screenshot_5.webp


I don't recall ever really making that many different types of upgrades but not sure.
 
So just to conclude this, it certainly seems to be at some point that the xf_user_upgrade table was truncated or otherwise dropped and recreated because you're now dealing with user_upgrade_id 6, but it appears as though your xf_user_upgrade_active table still has records which reach beyond that. That can only really happen if the active/expired tables were somehow brought in from a backup/restore process or simply were never cleared after the upgrade table was cleared.

If you're truly wishing to start from scratch, all I can suggest is truncating xf_user_upgrade, xf_user_upgrade_active and xf_user_upgrade_expired and that should resolve the problem.
 
Back
Top Bottom