# Profile preference 404 error/ admin profile not work

**URL:** <https://meta.discourse.org/t/profile-preference-404-error-admin-profile-not-work/216640>\
**Category:** Bug\
**Created:** [January 31, 2022, 10:01pm UTC](https://meta.discourse.org/t/profile-preference-404-error-admin-profile-not-work/216640 "2022-01-31T22:01:10Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [February 1, 2022, 12:06pm UTC](https://meta.discourse.org/t/profile-preference-404-error-admin-profile-not-work/216640/17 "2022-02-01T12:06:37Z")

</div>

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):

```plaintext
Select name, image_upload_id
FROM badges b
Order By id desc

```

* * *

> [@JammyDodger](#):
>
> I tried using the console to insert a “null” value in the `image_upload_id`

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

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

```plaintext
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?

---

_[View the full topic](https://meta.discourse.org/t/profile-preference-404-error-admin-profile-not-work/216640)._
