Custom Wizard Plugin


(Angus McLeod) #21

Ah yup. I noticed this bug yesterday as well. I fixed it here. If you ./launcher rebuild to get the latest plugin code it should work.


#22

@angus
Awesome. Its working for me now.


(ginger man) #23

This is really a good useful plugin. I have few questions.

Can we use this plugin to create multiple survey forms ( like a typeform ) anywhere within discourse ?

Can we configure a specific destination (category) for each wizard form we create to send the form entries ?


(Dante) #24

God of the plugin :face_with_monocle:


(Angus McLeod) #25

You could run a survey in a custom wizard, but you should have a good reason for using this over the more tested and targeted alternatives (i.e. third party survey form providers).

You can use “Actions” to configure a topic or a private message to be automatically created after a user submits a step or the form itself. The topic or private message can contain content entered by the user in any “Field” you add to the wizard. If the form setting “Save Submissions” is on (which I would recommend in most cases), all user input is also available in the admin panel under Wizards > Submissions.


(Al Romano) #26

Hello!

Came across your plugin and was curious if the following is possible using it (looking to make an Age/ID Verification system but realized your plugin could probably do a majority of the heavy lifting)?

Using the Wizard, I want to generate a random (but, unique) key that’s displayed and linked to the User filling out the Wizard and in the same step, they upload an image.

Upon completion, it sets the user to a custom group. That way the admin can look at the ID images & key to verify the user and then add the user to an age verified group manually.

Sidenote: will gladly pay to add this feature into the wizard plugin itself so everyone could benefit. PM me and we can talk.


(Angus McLeod) #27

Hey there :). Yes, you can implement the functionality you’ve referred to using this plugin. You can add basically any user input(s) to a wizard step, including an image upload field, and you can run any custom logic on that input(s) after the user submits the step.

I am a little confused however about what you’re trying to achieve. How will linking a randomly generated key with an image uploaded by the user verify that user’s identity or age?

I don’t take paid work, but I’m happy to advise (for free) anyone else you hire for the job. Post it in the #marketplace and we’ll take it from there.


[PAID] Extending Custom Wizard Plugin
(Al Romano) #28

This is similar to how finance websites do age verification, they make you take two photos with your ID and also randomly generate a key that’s linked to your account that has to appear in the image (you write it down).

I made the listing in #marketplace ! I appreciate the input!

Regards,
Al


#29

Thank you for this brilliant plugin.

I am trying to create a sign up wizard for an event. The user can enter his data and a message should be sent to an admin. I am having difficulties getting the user data into the message, because I can only add fields for title and post. It would be very nice if I could create a kind of template with text and fields.

My configuration

Configuration - Album on Imgur

It would be nice if anyone can point me to the right direction.


(Angus McLeod) #30

Just to confirm, you want multiple user inputs to be added to the same message right?


#31

Yes, that’s right. It would be nice if I could create a template like this:

Dear {firstname} {lastname},
thank you for signing up.

Or at least add some text and list the user input below.


(Ran) #32

So this maybe wasn’t the best plugin to start with as a newbie to ruby, but I’m migrating a forum from SMF to Discourse that is used for a volunteer group. I’m working on trying to assure all of the custom functionality we currently have can be recreated.

We have an application process right now, where new members provide a bit more information before they’re approved for full access to the forums. This info is posted to a locked area only visible to our Staff Organizers who them approve/adjust access to the user.

So this wizard would actually be a really nice streamlined update to that process, the current form isn’t really tied into new user login so its a pain directing people. Unfortunately I’ve hit a bit of a wall. At first I couldn’t get the wizard to fully submit, I recreated the Wizard from scratch after doing a force update and rebuild and now it completes, and data is saved to the table but its throwing an error when trying to post a new forum thread in a staff area for review:

Message
NoMethodError (undefined method include?' for nil:NilClass) /var/www/discourse/plugins/discourse-custom-wizard/lib/builder.rb:181:inblock (5 levels) in build’

Summary

/var/www/discourse/plugins/discourse-custom-wizard/lib/builder.rb:181:in block (5 levels) in build' /var/www/discourse/plugins/discourse-custom-wizard/lib/builder.rb:177:ineach’
/var/www/discourse/plugins/discourse-custom-wizard/lib/builder.rb:177:in block (4 levels) in build' /var/www/discourse/plugins/discourse-custom-wizard/lib/builder.rb:161:ineach’
/var/www/discourse/plugins/discourse-custom-wizard/lib/builder.rb:161:in block (3 levels) in build' /var/www/discourse/plugins/discourse-custom-wizard/lib/step_updater.rb:15:inupdate’
/var/www/discourse/plugins/discourse-custom-wizard/controllers/steps.rb:17:in update' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/basic_implicit_render.rb:4:insend_action’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:186:in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/rendering.rb:30:inprocess_action’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:20:in block in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:131:inrun_callbacks’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:19:in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/rescue.rb:20:inprocess_action’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/instrumentation.rb:32:in block in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:inblock in instrument’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in instrument' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:ininstrument’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/instrumentation.rb:30:in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/params_wrapper.rb:252:inprocess_action’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/railties/controller_runtime.rb:22:in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:124:inprocess’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/rendering.rb:30:in process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-0.10.5/lib/mini_profiler/profiling_methods.rb:76:inblock in profile_method’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal.rb:189:in dispatch' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal.rb:253:indispatch’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:49:in dispatch' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:31:inserve’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:50:in block in serve' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:ineach’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in serve' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:834:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:522:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:inpublic_send’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in method_missing' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:17:inblock in class:Constraints
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:46:in serve' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:50:inblock in serve’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in each' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:inserve’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:834:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-protection-2.0.0/lib/rack/protection/frame_options.rb:31:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in call!' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in call!' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in call!' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in call!' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in call!' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in call!' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/builder.rb:63:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/conditional_get.rb:38:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/head.rb:12:in call' /var/www/discourse/lib/middleware/anonymous_cache.rb:149:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/session/abstract/id.rb:232:in context' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/session/abstract/id.rb:226:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/cookies.rb:613:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/callbacks.rb:26:inblock in call’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:97:in run_callbacks' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/callbacks.rb:24:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/debug_exceptions.rb:59:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/show_exceptions.rb:31:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/logster-1.2.8/lib/logster/middleware/reporter.rb:31:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:36:incall_app’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:26:in call' /var/www/discourse/config/initializers/100-quiet_logger.rb:16:incall’
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/remote_ip.rb:79:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/request_id.rb:25:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/method_override.rb:22:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/runtime.rb:22:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/executor.rb:12:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/sendfile.rb:111:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-0.10.5/lib/mini_profiler/profiler.rb:171:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_bus-2.0.8/lib/message_bus/rack/middleware.rb:63:in call' /var/www/discourse/lib/middleware/request_tracker.rb:110:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:522:in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:inpublic_send’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in method_missing' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/urlmap.rb:68:inblock in call’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in each' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/urlmap.rb:53:incall’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.1/lib/unicorn/http_server.rb:606:in process_client' /var/www/discourse/lib/scheduler/defer.rb:87:inprocess_client’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.1/lib/unicorn/http_server.rb:702:in worker_loop' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.1/lib/unicorn/http_server.rb:549:inspawn_missing_workers’
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.1/lib/unicorn/http_server.rb:142:in start' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.1/bin/unicorn:126:in<top (required)>’
/var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in load' /var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in'
Env

hostname forums-app
process_id 10077
application_version d32c95b6e805365f77bf4120696437535127b7e5
HTTP_HOST forums.cookiebrigade.org
REQUEST_URI /w/new_brigadier/steps/about_you
REQUEST_METHOD PUT
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
HTTP_ACCEPT /
HTTP_REFERER New Brigadier Application
HTTP_X_FORWARDED_FOR 8.18.37.3
HTTP_X_REAL_IP 8.18.37.3
username chippy
params null


(Angus McLeod) #33

Hey. It looks like you’re using the create_topic action and you’ve added a field with a value but no key?

In any event, the builder shouldn’t fail like that. I’ve added a check.


(Ran) #34

Thanks that actually did solve the problem, but now I’m a bit confused by what exactly the “add fields to topic” is suppose to do. I assume it would be a way to post answers from the wizard into the body of the post, but that doesn’t seem to work, or I’m missing something.

I’m going to play with a bit more though, this is really nice, especially now that its working.


(Angus McLeod) #35

Yes. On reflection, I can see why it’s confusing.

“Add Fields To Topic” adds fields to the topic object / table row itself, e.g. featured_link or pinned_globally. I use it in my own wizards to add a bunch of custom_fields such as locations and events.

However, most users of this plugin will probably want to use user input to build the content of a post, either in a topic or a PM. @ploxnix wants the same thing. I realised today that I also need this.

I’ll add that feature in the next few days.


(Makary ) #36

I have a pretty funny issue:


It’s obvious that it is caused by non-english site, but… Shouldn’t if fall back to english labels in this case?


Advertising Plugin for Discourse - Serve Ads on your Discourse Forum (Official Endorsed)
(Angus McLeod) #37

Translation functionality (aside from the translations themselves) are handled by Discourse. I seem to recall that client-side fallbacks to English are not supported. @zogstrip Is that still true? Do I have to do anything in the plugin itself? @David_Taylor Is this something you’ve handled in a plugin before?


(Makary ) #38

Well, I have mixed language content on the admin panel, some core settings are in EN as well as most other plugins, it’s first time I see this kind of placeholders.

By the way, impressive work, as always :wink: Can’t wait to check this plugin out!


(Mittineague) #39

AFAIK, for plugins, there would need to be locale files for other languages. Pull Requests?


(Angus McLeod) #40

Yes, that’s what I thought as well, however there are a few topics that seem to suggest otherwise. But I’m not sure…


@MakaryGo That said, if you could provide a Polish translation that would be great :slight_smile: