mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 21:19:41 -06:00
FIX: Reorder categories not working
Ember was throwing this error preventing the reorder categories feature
from working:
```
access theidproperty (of <(unknown):ember1803>). ... the object in question
is a special kind of Ember object (a proxy). Therefore, it is still necessary
to use.get('id')in this case.
```
So I updated it to use the `get` method
https://api.emberjs.com/ember/3.14/functions/@ember%2Fobject/get
Follow up to: 6e5fedb312
This commit is contained in:
parent
3309a2b564
commit
f921909595
@ -79,7 +79,9 @@ function defaultCategoryLinkRenderer(category, opts) {
|
||||
let restricted = get(category, "read_restricted");
|
||||
let url = opts.url
|
||||
? opts.url
|
||||
: Discourse.getURL(`/c/${Category.slugFor(category)}/${category.id}`);
|
||||
: Discourse.getURL(
|
||||
`/c/${Category.slugFor(category)}/${get(category, "id")}`
|
||||
);
|
||||
let href = opts.link === false ? "" : url;
|
||||
let tagName = opts.link === false || opts.link === "false" ? "span" : "a";
|
||||
let extraClasses = opts.extraClasses ? " " + opts.extraClasses : "";
|
||||
|
Loading…
Reference in New Issue
Block a user