Profile preference 404 error/ admin profile not work

After a bit of experimenting, I can replicate this glitch (or possibly something similar). I tried using the console to insert a “null” value in the image_upload_id in the Badge table, and it filled it with 0 instead. That locked up my test site in a very similar way to what you’ve described.

I ‘fixed’ it by changing all the image_upload_id to ‘1’. That allowed me back into my profile and the Badges section, but I now have to manually swop all the badges back to icon only, etc.

To check if yours is a similar problem can you access your data-explorer and create a new query and paste this in (and run):

Select name, image_upload_id
FROM badges b
Order By id desc

I have also figured out that it wants ‘nil’ not ‘null’ in the console to work properly. :slightly_smiling_face:

This fixed my broken ones without needing to go through them all manually:

Badge.where('image_upload_id=0').find_each do |b|
b.image_upload_id = nil
b.save
end

Without knowing exactly what the issue with yours is, I can’t say for sure that will fix yours in the same way - though maybe a ‘change all to nil’ could work for you?

1 Like