# Solved plugin bug

**URL:** https://meta.discourse.org/t/solved-plugin-bug/37146
**Category:** Bug
**Tags:** solved
**Created:** [December 26, 2015, 10:40am UTC](https://meta.discourse.org/t/solved-plugin-bug/37146 "2015-12-26T10:40:13Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![axp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axp/32/116685_2.png) [@axp](https://meta.discourse.org/u/axp)
#### Post date: [December 26, 2015, 10:40am UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/1 "2015-12-26T10:40:13Z")

</div>

Hi

I’m on latest tests-passed (1.5.0beta7 +48) discourse with latest “solved” plugin and I have some problems while creating a new category.

Steps to repro (checked that on latest stable Chrome and IE11):

1. Create a new category
2. Tick “Allow users to accept answers” checkbox
3. Images and Templates after ticking are not clickable

updates: Also many elements are not clickable - search icon, hamburger menu, profile, avatars…

After trying this I get error on /logs:

`4 x Uncaught Error: Property set failed: object in path "custom_fields" could not be found or was destroyed. Url: http://example.com/assets/ember_jquery-c510009d3d7cecdf3f948f54d4922d9a.js Line: 8 Column`

Backtrace:

```
Error: Property set failed: object in path "custom_fields" could not be found or was destroyed.
    at new Error (native)
    at Error.r (http://example.com/assets/ember_jquery-c510009d3d7cecdf3f948f54d4922d9a.js:7:1941)
    at l (http://example.com/assets/ember_jquery-c510009d3d7cecdf3f948f54d4922d9a.js:8:720)
    at Object.u [as set] (http://example.com/assets/ember_jquery-c510009d3d7cecdf3f948f54d4922d9a.js:8:146)
    at e.default.s.Mixin.create.set (http://example.com/assets/ember_jquery-c510009d3d7cecdf3f948f54d4922d9a.js:11:13477)
    at set (http://example.com/assets/application-94d3f21e00d4c56244a228e913699af7.js:59:14809)
    at null.<anonymous> (http://example.com/assets/application-94d3f21e00d4c56244a228e913699af7.js:1:6056)
    at a.d._set (http://example.com/assets/ember_jquery-c510009d3d7cecdf3f948f54d4922d9a.js:6:26209)
    at a.d.set (http://example.com/assets/ember_jquery-c510009d3d7cecdf3f948f54d4922d9a.js:6:25840)
    at Object.u [as set] (http://example.com/assets/ember_jquery-c510009d3d7cecdf3f948f54d4922d9a.js:8:164)

```

PS: I don’t have any custom fields.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 26, 2015, 6:28pm UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/2 "2015-12-26T18:28:10Z")

</div>

Do you have any other third party plugins installed? If so disable them all.

---

<div class="post-metadata">

### Author: ![axp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axp/32/116685_2.png) [@axp](https://meta.discourse.org/u/axp)
#### Post date: [December 26, 2015, 7:33pm UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/3 "2015-12-26T19:33:43Z")

</div>

No. I have just tagging and solved plugin.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 5, 2016, 3:24am UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/4 "2016-01-05T03:24:22Z")

</div>

Was the site in English or another language?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [January 5, 2016, 3:38am UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/5 "2016-01-05T03:38:39Z")

</div>

Oops, I thought I already replied to this topic.

Few days ago I was looking into this issue and was able to repro this consistently. In fact I can repro this right now here on meta!

* * *

Repro Steps:

1. Click “Create a new category” button.
2. Open “Settings” tab.
3. Tick “Allow topic owner and staff to mark a reply as the solution” checkbox.
4. Notice there will be an error in console.

I tried to fix this issue and was able to pinpoint the code causing this issue:

[https://github.com/discourse/discourse-solved/blob/master/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js.es6#L18](https://github.com/discourse/discourse-solved/blob/master/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js.es6#L18)

```plaintext
this.set("custom_fields.enable_accepted_answers", value);

```

^^ `custom_fields` is not defined when **creating new category** , however it is defined when editing the category.

I spent considerable time on this issue and was not sure how to fix this. ☹

@eviltrout can you look into this?

* * *

Also related:

[https://meta.discourse.org/t/discourse-solved-accepted-answer-plugin/30155/108?u=techapj](https://meta.discourse.org/t/discourse-solved-accepted-answer-plugin/30155/108)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 25, 2016, 4:00am UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/6 "2016-10-25T04:00:23Z")

</div>

Is this still an issue @techapj?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [October 25, 2016, 4:36am UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/7 "2016-10-25T04:36:11Z")

</div>

Yes, this bug still exists. Can repro here on meta.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 27, 2016, 7:12pm UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/8 "2016-10-27T19:12:16Z")

</div>

I recently tried using the same code for adding category custom fields to a plugin and ended up getting the same error when attempting to add the custom field while creating a new category. The feature-voting plugin also uses the same pattern and produces the same error. Is there a way to get this to work so that custom fields can be added when creating a new category?

Quick and easy solutions are either disable the checkbox in the category-custom-fields connector if `category.custom_fields` is not defined, or to move the plugin’s category selection into site-settings.

---

<div class="post-metadata">

### Author: ![leo.proctor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leo.proctor/32/216158_2.png) [@leo.proctor](https://meta.discourse.org/u/leo.proctor)
#### Post date: [April 16, 2017, 3:12pm UTC](https://meta.discourse.org/t/solved-plugin-bug/37146/9 "2017-04-16T15:12:24Z")

</div>

Hi, any progress on this? Is `category.custom_fields` still not defined while creating a new category?
