Custom Wizard Plugin

(Orlando Del Aguila) #164

Perfecto :ok_hand:, I’ll do that


(Angus McLeod) #165

Could be the way its configured, or could be an issue with the plugin.

  1. Attach a screenshot of the wizard settings (hide it with the details feature so the post isn’t huge).


  2. Open the browser console and have a look for errors.

(Craig Davison) #166

I think the problem might be to do with the fact that the theme cannot be selected in settings.

Page source
    <link href="/stylesheets/wizard_d8693ddee7be990ffecf5171898454a3e9291e19.css?" media="all" rel="stylesheet" data-target="wizard"/>
    <link rel="stylesheet" media="all" href="/assets/wizard_custom-d15d6376544ac07576ea8d5460d5aa983b87fe499731f269e24c43297b2f52c7.css" data-turbolinks-track="reload" />
    <link rel="stylesheet" media="all" href="/assets/wizard_composer-282e8d43197860c43be6f00f10f76acc8f8e28229008adc12b9f1f71865d9608.css" data-turbolinks-track="reload" />
    <link rel="stylesheet" media="all" href="/assets/wizard_variables-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css" data-turbolinks-track="reload" />
    <link rel='preload' href='/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js' as='script'/>
<script src='/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js'></script>
    <link rel='preload' href='/assets/wizard-vendor-de512c6b1fa732a99b50846017a00cbd8ba8a0392a2bce350e8476a83fa1ccb5.js' as='script'/>
<script src='/assets/wizard-vendor-de512c6b1fa732a99b50846017a00cbd8ba8a0392a2bce350e8476a83fa1ccb5.js'></script>
    <link rel='preload' href='/assets/wizard-application-965c5ac965e7b66088a48b8a68ef5e7d34ada0256b78a66e2ac34882e6455c14.js' as='script'/>
<script src='/assets/wizard-application-965c5ac965e7b66088a48b8a68ef5e7d34ada0256b78a66e2ac34882e6455c14.js'></script>
    <link rel='preload' href='/assets/wizard-custom-lib-33df3cb75a5fb5c73efac498cbfacc1d58022e13d6dbd1f1b16f1805fc041e7d.js' as='script'/>
<script src='/assets/wizard-custom-lib-33df3cb75a5fb5c73efac498cbfacc1d58022e13d6dbd1f1b16f1805fc041e7d.js'></script>
    <link rel='preload' href='/assets/wizard-custom-bf733f1e175e62d032f3bae9110b04a04dbd1088d3600a260f1f3051b20eb293.js' as='script'/>
<script src='/assets/wizard-custom-bf733f1e175e62d032f3bae9110b04a04dbd1088d3600a260f1f3051b20eb293.js'></script>
    <link rel='preload' href='/assets/wizard-plugin-478320548ac1b714655e0eb36ba1753732e2568de422d9e01cd26898bbf66717.js' as='script'/>
<script src='/assets/wizard-plugin-478320548ac1b714655e0eb36ba1753732e2568de422d9e01cd26898bbf66717.js'></script>
    <link rel='preload' href='/assets/pretty-text-bundle-4ff668189f39bd8c9ceddd6bca26f92fd6b12d04bbd40c92eb44b34e2c741246.js' as='script'/>
<script src='/assets/pretty-text-bundle-4ff668189f39bd8c9ceddd6bca26f92fd6b12d04bbd40c92eb44b34e2c741246.js'></script>
    <link rel='preload' href='/assets/locales/en-96b26800f2525bb82b409616a67ea92d23ee61aba9aca3be52d3db48ed37c10e.js' as='script'/>
<script src='/assets/locales/en-96b26800f2525bb82b409616a67ea92d23ee61aba9aca3be52d3db48ed37c10e.js'></script>

<link rel="preload" href="/assets/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2?" as="font" type="font/woff2" crossorigin />
  @font-face {
    font-family: 'FontAwesome';
    src: url('/assets/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2?') format('woff2'),
         url('/assets/fontawesome-webfont-ba0c59deb5450f5cb41b3f93609ee2d0d995415877ddfa223e8a8a7533474f07.woff?;2&v=4.7.0') format('woff');

    <script src="/extra-locales/wizard"></script>
    <meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="ZCLGkryB3XWY/34zdN/3idRtQX2fwQckUkVmMh1a8I4nAZ6t1BrhzOCOFBwshmpY+RXNgxx2b3QjJlckh5DWIg==" />



    <meta name="discourse_theme_key" content="">
    <meta name="discourse-base-uri" content="">

    <meta name="author" content="">
<meta name="generator" content="Discourse 2.1.0.beta2 - version 1ad358fa0aee5b576dd928a7c8cd20999da99a05">
<link rel="icon" type="image/png" href="/uploads/default/original/1X/1c58e2e5aff2d28fb2967d957d5b6a3f109d089a.png">
<link rel="apple-touch-icon" type="image/png" href="/uploads/default/original/1X/b621cc02167dc49f6174c428e33c990990a0fd69.png">
<link rel="icon" type="image/png" sizes="144x144" href="/uploads/default/original/1X/b621cc02167dc49f6174c428e33c990990a0fd69.png">
<meta name="theme-color" content="#ffffff">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes">

<script type="application/ld+json">{"@context":"","@type":"WebSite","url":"","potentialAction":{"@type":"SearchAction","target":"{search_term_string}","query-input":"required name=search_term_string"}}</script>
<link rel="search" type="application/opensearchdescription+xml" href="" title="EuroDiscover Community Search">


  <body class='custom-wizard'>
    <div id='custom-wizard-main'></div>


      (function() {
        var wizard = require('discourse/plugins/discourse-custom-wizard/wizard/custom-wizard').default.create();
  <script async type="text/javascript" id="mini-profiler" src="/mini-profiler-resources/includes.js?v=251162ee7dc30da30d5370581c664510" data-version="251162ee7dc30da30d5370581c664510" data-path="/mini-profiler-resources/" data-current-id="xudrb1o23awkuz2iahmw" data-ids="xudrb1o23awkuz2iahmw" data-horizontal-position="left" data-vertical-position="top" data-trivial="false" data-children="false" data-max-traces="20" data-controls="false" data-authorized="true" data-toggle-shortcut="Alt+P" data-start-hidden="false" data-collapse-results="true" data-html-container="body"></script>

No browser console errors.

(Daniel Nevoigt) #167

I have the same issue with themes selecting. In my case its just possible to select the first theme and the first point, select a theme (optional). When I move my theme for wizard to the top, it also does not load the .css inside, so I can select what I want, everytime the wizard is in raw format.

(Angus McLeod) #168

@davisonio @Daniel_Nevoigt The way themes are handled in core Discourse was recently changed.

I just pushed an update to the plugin that should accomodate the changes:

@sam Is there a way I can better prepare for / more gracefully handle db schema changes in my plugins?

(Daniel Nevoigt) #169

Works like a charm now. Thanks a lot @angus

(Allen) #170

Many thanks for this awesome plugin!

I am trying to update Bio field in user profile through wizard. As target field I selected bio_raw, for the input field I tried various including text area and composer. So far I have not managed to get user input from Wizard to update Bio field in user profile. Updating checkbox (consent in my example) works. Am I doing something wrong?

(Angus McLeod) #171

It seems to be working fine on my sandbox. Can you link me to an example of it not working?


Wizard input:


Profile after submission:


Wizard settings:

(Allen) #172

hmm, i created an additional step, identical to my first, and that one works. I did some field name changes in a convoluted way on my first attempt, and that probably messed up something. Anyhow, I will just delete the whole wizard and start over again, I am confident it will work now. Thanks for confirming that it wasn’t some odd problem with the profile field.

(jacob) #173

Here’s an error I found while using the plugin today. Could this be the cause to the wizard not changing themes appropriately?

(Mathew Medoff) #174

I noticed that the validation done does not appear to strip leading and trailing white spaces. Was able to create fields that have a minimum length and then uses spaces to meet that minimum. For example I could put a minimum of 5 and then simply put in 5 spaces and it is successful.

(Sam Saffron) #175

@Osama do you remember the wrapping we did for themes? I think it may make sense to add this for plugins as well? Not sure, but something to think about. Worth a 15-20 minute round of investigating what issues there are and how plugins should deal with this on static pages. I keep seeing these errors on meta.

(Jacob) #178

Is there a way to have wizard fields in a custom title? It doesn’t work for me and one other person said they can’t use user fields. I’m assuming you can’t but I am still gonna ask. sorry for bump, idk forum etiquette or where I should ask this

(Christoph) #179

Could you clarify how exactly the wizard acts after the final step? The OP mentions that

But what happens in all other cases?

The way I have setup the wizard, the user is redirected to the PM that was created by one of the wizard actions, so I’m guessing that the user is redirected based on the (last?) wizard action. But what if a user is invited and a PM is created? (etc)

Oh, and I just realized that the last action of my wizard is actually not the pm but updating a field in the user profile. So I’m not sure what the logic is. :thinking:

Ultimately, what I’m trying to find out is whether there is a way of directing the user to /latest or a specific category or topic once the wizard is completed (except, of course, in the case of topic invites). In particular, I don’t want new users to be redirected to the PM that was created by the wizard. Is there any way of preventing that?

(Angus McLeod) #180

There is now!

If there are no create_topic or create_message actions in the wizard, then the user will just be directed to latest.

If there are create_topic or create_message actions, then whatever action appears last in the wizard will determine what the user is redirected to. The action doesn’t need to be in the last step.

For example, if you have a create_message in step 2 and a create_topic in step 4 of a 5 step wizard, the user will be redirected to the topic.

I’ve added a ‘skip redirect’ option for create_topic and create_message which should address the your use case.

(Christoph) #181

Thanks a lot for those features!

I just received a wizard generated PM from a user who signed up 9 months ago. Was she redirected to the wizard because I had the required option activated? If so, it was totally not clear to me that this would happen if I don’t have after time activated (which I don’t have).

As I think about it more, I’d even say it is logically inconsistent that “required” automatically overwrites everything else.

I’m not sure if I’m expressing myself clearly, so, in concrete terms, I wanted to use the wizard for the onboarding of new users when they sign up (and existing users wouldn’t even know the wizard exists) and I don’ t want to allow them to skip the wizard, hence I activated After signup and required. It looks like it’s currently not possible to do that without also bugging existing users with the wizard. Is that intentional?

(Jacob) #182

I have a wizard that makes a topic, users can do it multiple times. If you hit enter at the end of the wizard it will take you to the last topic you made through the wizard instead of making a new topic.

(Angus McLeod) #183

@tophee The ‘Required’ setting does not affect whether or not you see the wizard. It only affects whether you can skip the wizard or not once you’re in it. Was that one case the only case of an existing user seeing the wizard? Did she say how (e.g. was she signing in?) she saw the wizard? The settings you have currently should work for your desired use case. If they are not, there’s an issue.

I’m a little confused. Could you spell out in more detail how you’ve set up each step of the wizard, what happens and what you expect to happen? Thanks.

(Jacob) #184

This is what my last page looks like. If they click done, it will create a new topic like normal, but if they hit enter while in the “Reason and Comments” text bar to submit the page, it will take them to the last post they made.

When I click enter in the text area it leads me here. This is a deleted test from 5 hours ago and it doesn’t make a new topic.

When I click done it completes like normal and creates a new topic.

(Christoph) #185

Yes, because I immediately turned off the wizard to make sure that it doesn’t happen again.

I did not communicate with her but I can see that she was logging in (i.e. visiting the forum), yes. The forum is not public. I am also pretty sure that her logging in was a reaction to the digest email she received just a fee moments earlier. So it is likely that she clicked on a link in that mail to get to the forum.

Then there is an issue. But how do we track it down?