From 8751dc297a6b8b6ad82a963a5689b3c0be50753b Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 4 Nov 2024 13:24:30 +0100 Subject: [PATCH] FIX: Prevent exception for non-subscribers --- .../discourse/controllers/admin-wizards-wizard-show.js.es6 | 5 ++++- .../discourse/routes/admin-wizards-wizard-show.js.es6 | 1 + plugin.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/controllers/admin-wizards-wizard-show.js.es6 b/assets/javascripts/discourse/controllers/admin-wizards-wizard-show.js.es6 index c971a3db..ad0776a0 100644 --- a/assets/javascripts/discourse/controllers/admin-wizards-wizard-show.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-wizards-wizard-show.js.es6 @@ -94,8 +94,11 @@ export default Controller.extend({ }, setAfterTimeGroupIds() { + if (!this.wizard.after_time_groups) { + return; + } const groups = this.site.groups.filter((g) => - this.wizard.after_time_groups?.includes(g.name) + this.wizard.after_time_groups.includes(g.name) ); this.setProperties({ afterTimeGroupIds: groups.map((g) => g.id), diff --git a/assets/javascripts/discourse/routes/admin-wizards-wizard-show.js.es6 b/assets/javascripts/discourse/routes/admin-wizards-wizard-show.js.es6 index 9934b003..fc8a17f9 100644 --- a/assets/javascripts/discourse/routes/admin-wizards-wizard-show.js.es6 +++ b/assets/javascripts/discourse/routes/admin-wizards-wizard-show.js.es6 @@ -44,6 +44,7 @@ export default DiscourseRoute.extend({ currentStep: wizard.steps[0], currentAction: wizard.actions[0], creating: model.create, + afterTimeGroupIds: [], }; controller.setProperties(props); diff --git a/plugin.rb b/plugin.rb index c5c5adf3..e3465b91 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # name: discourse-custom-wizard # about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more. -# version: 2.9.1 +# version: 2.9.2 # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos # url: https://github.com/paviliondev/discourse-custom-wizard # contact_emails: development@pavilion.tech