Fixed Upgrade Wipes Off All Custom User Fields Data

That doesn't appear to be the case:

189409

There was an issue in the initial beta but this was resolved in beta 2. This didn't actually wipe any custom field data, but it did mean that the user field value caches didn't get converted. But, as I say, this was sorted in beta 2.

However, have you run the "Rebuild users" tool under "Rebuild caches" in the Admin CP at all?
 
The fields are there. But, the data is wiped off.
Actually checked my data after upgrade and it was all gone.
I checked for my a/c (admin) and it is all blank. In fact, one custom add on (dataLog) requires custom fields to be filled before the module can be accessed. However, when I tried accessing that it asked for custom fields update.

After Upgrade -- I did rebuild user caches.

I was trying to be brave to switch LIVE forum to BETA 4, but now not going back :)
I can ask users to fill those custom fields again.
 
The reason I asked is because I spotted and fixed this earlier, so that will be sorted in the next beta. This affected thread field caches too.
 
The reason I asked is because I spotted and fixed this earlier, so that will be sorted in the next beta. This affected thread field caches too.
Okk.
So that means the data is gone right?
Just trying to be sure before I push out notice for members to update those fields.
In user changelog the data is there.
 
No, the caches are gone but actual master values are still there. It is the user rebuild which set the cache value in the wrong format. Once upgrading to the next beta, you'd just need to re-run the User rebuild again and they'll all come back.

If you want to fix it now, edit the file src/XF/Repository/UserField.php.

Find:
PHP:
['custom_fields' => serialize($cache)]
And replace with:
PHP:
['custom_fields' => json_encode($cache)],

If you make use of custom thread fields too, it's the same changes but in the file src/XF/Repository/ThreadField.php.

And then run the user rebuild again.
 
The "Rebuild threads" rebuild.

(You don't need to click the rebuild post and position counters option).
 
Brilliant. All fixed. Yes, there were huge no of posts with custom fields and in fact i did notice about missing data while testing video upload, but thought must have messed while doing from phone.

All looks good now :)

Thank you so much 🙏
 
Top Bottom