Create topic that creates an event with official Discourse Events plugin

I’m having some trouble and wondering where I’m going wrong. I am creating a custom wizard for a person to fill out which then generates a topic with a preformatted Discourse Events entry.

I’ve created fields for the date, start time, end time, name, and url. I used the Post Builder to enter this information, like this:

[event start="w{step_1_field_1} w{step_1_field_2}" status="public" name="w{step_1_field_7} w{step_1_field_1}" url="w{step_1_field_4}" timezone="America/New_York" end="w{step_1_field_1} w{step_1_field_5}" allowedGroups="trust_level_0" reminders="bumpTopic.2.hours,notification.15.minutes"] [/event]

But, when the user fills out the form, the topic is not created and there’s a banner at the top of the wizard that says <!DOCTYPE html>.

After a while, I checked again in the category, and it indicated there were new topics, but they didn’t appear, they’re just…not there. I checked the wizard submissions, and one of my attempts was listed, then it disappeared, I tried two more times, the submissions didn’t appear; then tried a fourth time and that submission did appear.

Not sure where I’m going wrong! The logs section is completely empty, too.

Sorry to hear you are having trouble, Jen.

Are you able to make a simpler wizard work?

I’m not sure - this is a form to make it easier for office staff to announce a regular meeting without having to go through the process of creating an event each time, so I’m not sure how to make it simpler exactly.

It is a really good idea - and something I’ve been meaning to do myself!

What I meant was can you make a simple test wizard work nicely? I just want to understand if the whole plugin is working well before digging into the wizard itself.

Also, would you mind posting the .json for the wizard as it is? I’ll then give it a test run in this site.

Hi Jen - did you get anywhere with this?

I didn’t, unfortunately.

I use custom wizard forms elsewhere on the site with no issue - it seems that trying to use it with Discourse Events is the issue.

What I’m noticing in the json export of the form is that [ is being replaced by \u003c and ] is being replaced by \u003e.

What it should output to the post:
[event start="w{step_1_field_1} w{step_1_field_2}" status="public" name="w{step_1_field_7} w{step_1_field_1}" url="w{step_1_field_4}" timezone="America/New_York" end="w{step_1_field_1} w{step_1_field_5}" allowedGroups="trust_level_0" reminders="bumpTopic.2.hours,notification.15.minutes"] [/event]

Actual output according to the json export:
"post_template":"\u003cevent start=\"w{step_1_field_1} w{step_1_field_2}\" status=\"public\" name=\"w{step_1_field_7} w{step_1_field_1}\" url=\"w{step_1_field_4}\" timezone=\"America/New_York\" end=\"w{step_1_field_1} w{step_1_field_5}\" allowedGroups=\"trust_level_0\" reminders=\"bumpTopic.2.hours,notification.15.minutes\"\u003e\n\u003c/event\u003e"

How frustrating! It does look like a bug; would you mind if I shift your posts to the topic to open it up to others?

Sure, that’d be fine.

I exported the form and changed u003e and u003c to the correct unicode; imported it back in to the Custom Wizard and unfortunately that didn’t work.

Hey guys, here’s an example of how to create an Discourse Events event with the Custom Wizard plugin

Hi, so sorry but this video is not playing for me - all of the buttons are grayed out and trying to copy the video address and running it in new tab gives me an error.

Also tried to extract just the address to the .mp4 but that didn’t seem to work either.

What browser are you using Jen? Here’s a direct link.

https://www.loom.com/share/005f0f24aebf46ea91451deecf95c21a?sid=dfa11bfc-92dd-4226-a24e-d10f5aaf0105

same for me

Firefox 124.0 (64 bit) on Windows 11

It says “no video with supported format and mime type found” and click with the right button on it and using “open video in new tab” does run on error and the following information is shown:

“No style information appears to be linked to this XML file. The tree view of the document is displayed below.”

<Error>
<Code>InvalidKey</Code>
<Message>Unknown Key</Message>
</Error>

The direct link is working fine.

Apologies Guido - this was broken by a Discourse change. I’ve rebaked the post so it should work for you now.

I’ll look to doing a targetted rebake of all video containing posts on this site shortly.

nope, does still not yet work in Firefox on Windows.


But it does work fine in Edge Chromium on Windows.

Interesting - it could be that the ‘fix’ is only a fix for Chromium. This wouldn’t just be a problem for us. But glad you can now watch the video!

If I get some time soon, I’ll have a go repro’ing it and make a bug report on meta.discourse.org - you would of course be welcome to do that too.

I don’t think it has anything to do with Discourse. The video is simply “not found” on Loom’s server.

Note that the thumbnail is a three second animated gif so it appears to play at first glance but it does not.

I’ve just rebaked the HTML and it works for me now properly (saw the GIF before).

Could this be a casualty of our hosting move? However, I’m sure you would have done a post rebake as part of that, eh?

I have literally moved hundreds of forums and never had to do a post rebake.

And it was not working before the move either?

EDIT I see that Loom generates a signed URL when the post is being rebaked. My guess is that the signature expires after a certain time.

There was a change in how Discourse handles Loom videos.

1 Like