Revert "Import getURL to fix deprecation warnings (#72)"

Revert “Import getURL to fix deprecation warnings (#72)”

This reverts commit e3a6a64193ed4546f1b8c19e55ee3c27248af7f4.

This sadly broke our build

diff --git a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6 b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
index 56b7534..9f2f67e 100644
--- a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
+++ b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6
@@ -5,7 +5,6 @@ import { iconHTML, iconNode } from "discourse-common/lib/icon-library";
 import { h } from "virtual-dom";
 import { queryRegistry } from "discourse/widgets/widget";
 import { getOwner } from "discourse-common/lib/get-owner";
-import getURL from "discourse-common/lib/get-url";
 import { htmlSafe } from "@ember/template";
 
 function titleForState(user) {
@@ -102,7 +101,10 @@ function initialize(api) {
     },
     customHref: category => {
       if (category) {
-        return getURL(category.url) + "/l/latest?status=open&assigned=nobody";
+        return (
+          Discourse.getURL(category.url) +
+          "/l/latest?status=open&assigned=nobody"
+        );
       }
     },
     forceActive: (category, args, router) => {
@@ -171,7 +173,7 @@ function initialize(api) {
     @computed("assigned_to_user")
     assignedToUserPath(assignedToUser) {
       const siteSettings = api.container.lookup("site-settings:main");
-      return getURL(
+      return Discourse.getURL(
         siteSettings.assigns_user_url_path.replace(
           "{username}",
           assignedToUser.username
@@ -183,7 +185,7 @@ function initialize(api) {
   api.modifyClass("model:bookmark", {
     @computed("assigned_to_user")
     assignedToUserPath(assignedToUser) {
-      return getURL(
+      return Discourse.getURL(
         this.siteSettings.assigns_user_url_path.replace(
           "{username}",
           assignedToUser.username

GitHub sha: c49a1288

@markvanlan

Getting build failures per:

SassC::SyntaxError: Error: error in C function image-url: TypeError: javascripts/initializers/extend-for-policy: Duplicate declaration "getURL"
        on line 90 of app/assets/stylesheets/common/base/onebox.scss, in function `image-url`
        from line 90 of app/assets/stylesheets/common/base/onebox.scss, in mixin `onebox-favicon`
        from line 111 of app/assets/stylesheets/common/base/onebox.scss
        from line 12 of app/assets/stylesheets/common.scss
        from line 1 of desktop.scss
>>     background: image-url("favicons/#{$image}.png") no-repeat 0% 50%;

@SamSaffron the error comes from this file: discourse-policy/extend-for-policy.js.es6 at 55337d7ee23a32b52215ed13cf3c05f900f77e1f · discourse/discourse-policy · GitHub

Fixed/reverted the invalid commit in Revert "DEV: Import getURL to fix deprecation warnings (#13)" · discourse/discourse-policy@21a07c6 · GitHub

1 Like

I added it back in.

1 Like