From 743af8edc522748d34aa6fd6704537005ae077df Mon Sep 17 00:00:00 2001 From: Faizaan Gagan Date: Wed, 5 May 2021 11:35:53 +0530 Subject: [PATCH] FIX: breakage due to core changes (#107) --- .../discourse/initializers/custom-wizard-redirect.js.es6 | 2 +- assets/javascripts/discourse/lib/wizard-schema.js.es6 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/initializers/custom-wizard-redirect.js.es6 b/assets/javascripts/discourse/initializers/custom-wizard-redirect.js.es6 index 21dd0e81..e413cd17 100644 --- a/assets/javascripts/discourse/initializers/custom-wizard-redirect.js.es6 +++ b/assets/javascripts/discourse/initializers/custom-wizard-redirect.js.es6 @@ -21,7 +21,7 @@ export default { actions: { willTransition(transition) { const redirectToWizard = this.get("currentUser.redirect_to_wizard"); - const excludedPaths = Discourse.SiteSettings.wizard_redirect_exclude_paths + const excludedPaths = this.siteSettings.wizard_redirect_exclude_paths .split("|") .concat(["loading"]); diff --git a/assets/javascripts/discourse/lib/wizard-schema.js.es6 b/assets/javascripts/discourse/lib/wizard-schema.js.es6 index d196f387..8b8200b0 100644 --- a/assets/javascripts/discourse/lib/wizard-schema.js.es6 +++ b/assets/javascripts/discourse/lib/wizard-schema.js.es6 @@ -1,4 +1,5 @@ import { get, set } from "@ember/object"; +import { getOwner } from "discourse-common/lib/get-owner"; const wizard = { basic: { @@ -222,7 +223,8 @@ export function buildFieldValidations(validations) { wizardSchema.field.validations = validations; } -if (Discourse.SiteSettings.wizard_apis_enabled) { +const siteSettings = getOwner(this).lookup("site-settings:main"); +if (siteSettings.wizard_apis_enabled) { wizardSchema.action.types.send_to_api = { api: null, api_endpoint: null,