Automation > Data Explorer Query parameters > config > save button also saves the main form

AI-generated summary

andresfromsonar reported a bug in the Discourse Automation plugin where clicking “Save Changes” within the Data Explorer Query parameters configuration modal unexpectedly submits the main automation form. This behavior occurs even if no changes were made to the main form, potentially causing the user to be redirected to the main Automations list if the form is valid, or failing silently if mandatory fields are missing. The reporter noted this is unexpected and problematic for workflow. zogstrip acknowledged the issue and confirmed it will be resolved via pull request #44479.

Hey there, I ran into a behavior which is in my opinion a bug (or at least, very unexpected!). Here we go:

  • Go to Plugins > Automation > Add automation.
  • Select script: Schedule a PM with Data Explorer results.
  • Set Trigger: Recurring.
  • Next to Data Explorer Query parameters, click Configure.
  • Click Save Changes. This not only saves the data query params, but it also attempts to save/submit the main automation form itself. I would argue this is unexpected.

If you follow these exact steps, the form won’t actually be submitted because there are some mandatory fields missing. If you try it with a valid form, the whole thing will be saved and it will take you all the way back to the main Automations list.

Edge case: if you try it on an existing automation but without making any change at all, it won’t try to submit the form. I guess it’s smart enough to see that there are no changes.

thanks for the report @andresfromsonar :+1:

will be fixed by

https://github.com/discourse/discourse/pull/44479