# 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:** 1\
**Showing post:** 5

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

---

_[View the full topic](https://meta.discourse.org/t/solved-plugin-bug/37146)._
