mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:13:58 -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 restricted = get(category, "read_restricted");
|
||||||
let url = opts.url
|
let url = opts.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 href = opts.link === false ? "" : url;
|
||||||
let tagName = opts.link === false || opts.link === "false" ? "span" : "a";
|
let tagName = opts.link === false || opts.link === "false" ? "span" : "a";
|
||||||
let extraClasses = opts.extraClasses ? " " + opts.extraClasses : "";
|
let extraClasses = opts.extraClasses ? " " + opts.extraClasses : "";
|
||||||
|
Loading…
Reference in New Issue
Block a user