mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 06:56:01 +08: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: 6e5fedb31281fb40e672ffb87e767afcffd35e38
This commit is contained in:
@ -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 : "";
|
||||
|
Reference in New Issue
Block a user