# Unable to alter the lock icon in category boxes

**URL:** https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133
**Category:** UX
**Created:** [December 15, 2021, 2:53am UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133 "2021-12-15T02:53:45Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 15, 2021, 2:53am UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/1 "2021-12-15T02:53:45Z")

</div>

I’ve used [Category Icons](https://meta.discourse.org/t/category-icons-component/104683) to change the category locks icon to `unlock-alt`, which is great.

They are applied to all categories and subcategories appropriately except the `category-box-heading`. You’ll note that the subcategory titles have the replacement icon with no problem:

> ![image](https://global.discourse-cdn.com/meta/original/3X/1/2/125919c62ba9b2fab10341cc18ccf771e8d7a979.png).

When inspecting the boxes, I note that the text for the category-box-heading is not wrapped in `category name here, and the icon assigned to it is the default one (not the one it has been changed to).

Apologies if this is actually related to the Theme Component, but I’m pretty sure it is something in core.

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [December 15, 2021, 6:39am UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/2 "2021-12-15T06:39:14Z")

</div>

Some of this is in core, and some of it is in the component. These two PRs should fix the issue when merged

[https://github.com/discourse/discourse/pull/15309](https://github.com/discourse/discourse/pull/15309)

[https://github.com/discourse/discourse-category-icons/pull/9](https://github.com/discourse/discourse-category-icons/pull/9)

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 15, 2021, 10:47pm UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/3 "2021-12-15T22:47:50Z")

</div>

Thanks Joe - I’ve updated both discourse and the component, but the behaviour hasn’t changed. This example is for subcategories but it is the same for boxes on the `/c` page.

> ![image](https://global.discourse-cdn.com/meta/original/3X/b/e/be85d51f7ac8a7b273baaad38ab1fa64870a539c.png)

When I inspect it, I can see the additional wrapping - that is in there nicely, but still the wrong lock icon:

```plaintext
<svg class="fa d-icon d-icon-lock svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#lock"></use></svg>

```

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [December 15, 2021, 11:12pm UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/4 "2021-12-15T23:12:18Z")

</div>

What commit is the site you’re seeing this issue on?

Right-click \> view page source \> Look for the Meta Generator tag.

It looks like this

```plaintext
<meta name="generator" content="Discourse 2.8.0.beta9 - https://github.com/discourse/discourse version 5e534e58973730ad43026455821966a352e8477a">

```

Can you share that here?

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 15, 2021, 11:33pm UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/5 "2021-12-15T23:33:19Z")

</div>

In [betterstreets.nz](http://betterstreets.nz), but you won’t see any locked icons unless you join (which you are welcome to do).

Here 'tis:

```plaintext
<meta name="generator" content="Discourse 2.8.0.beta9 - https://github.com/discourse/discourse version 1c9a0fe18e19831277fd1c1be6d28559b3bad108">

```

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [December 15, 2021, 11:45pm UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/6 "2021-12-15T23:45:04Z")

</div>

The theme component is not updated on your site. I’m seeing this.

> **Summary**
>
> ```javascript
> let lockIcon = settings.category_lock_icon || "lock";
> 
> categoryTitleLink.default.reopen({
> lockIcon: lockIcon
> });
> 
> ```

when it should be

> **Summary**
>
> ```javascript
> let lockIcon = settings.category_lock_icon || "lock";
> 
> categoryTitleLink.reopen({
> lockIcon: lockIcon,
> });
> 
> categoriesBoxes.reopen({
> lockIcon: lockIcon,
> });
> 
> categoriesBoxesWithTopics.reopen({
> lockIcon: lockIcon,
> });
> 
> ```

Like it is here

[discourse-category-icons/javascripts/discourse/initializers/category-icons.js at main · discourse/discourse-category-icons · GitHub](https://github.com/discourse/discourse-category-icons/blob/main/javascripts/discourse/initializers/category-icons.js#L21-L33)

Head to the component page on your site and make sure that the `source` link is pointing to the correct repository

 ![component source link](https://global.discourse-cdn.com/meta/original/3X/7/1/71adbced5c80fc77ba1448519f90f5ba4a80f25c.png)

`https://github.com/discourse/discourse-category-icons`

Also, double check if you have multiple copies of the component installed. Check if the one that’s active is up to date.

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 15, 2021, 11:57pm UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/7 "2021-12-15T23:57:52Z")

</div>

Hmmm, all looks good at my end. Only one component, correct repository, activated.

> ![image](https://global.discourse-cdn.com/meta/original/3X/3/4/346eb68e34b7e64e3fbfbfda61686c46e5ce1e90.png)

Source is:

![image](https://global.discourse-cdn.com/meta/original/3X/5/2/52b30ec4230d399cc5fb17fe5c27940a89844f31.png)

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [December 16, 2021, 12:15am UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/8 "2021-12-16T00:15:37Z")

</div>

Not really sure at this point. Looking through the settings, I see you’re only using this for the lock icon, right? Can you try deleting the component and installing it again?

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [December 16, 2021, 12:20am UTC](https://meta.discourse.org/t/unable-to-alter-the-lock-icon-in-category-boxes/212133/9 "2021-12-16T00:20:01Z")

</div>

> [@Johani](#):
>
> Can you try deleting the component and installing it again?

🥳 Well, that worked!!! 🥳

Thanks for your above and beyond the call of duty persistent support for me on this Joe!

I’ll now apply it to our other sites, deleting and re-installing the component each time. I’m unsure what that triggered but hey, it works.
