Mautic forms keep trying to load while mautic is down (ex. Maintenance)

Created on 1 October 2024, 3 months ago

Problem/Motivation

When Mautic is not available or responds slowly, the embedded forms can block the page load, leading to a poor user experience. This is because the script tag for loading Mautic forms is not deferred, and there's no timeout mechanism in place.

Steps to reproduce

1. Set up a Drupal site with the Mautic Paragraph module.
2. Configure a Mautic form to be displayed on a page.
3. Temporarily disable or slow down your Mautic instance.
4. Load the page with the Mautic form.
5. Observe that the page load is blocked or significantly delayed.

Proposed resolution

1. Add the `defer` attribute to the script tag in the Twig template to prevent blocking page load.
2. Implement a timeout setting in the MauticParagraphConnectorPluginBase to allow users to set a maximum wait time for Mautic responses.

A new field will be added to the Mautic connector configuration form to allow setting the timeout value.

API changes

No significant API changes. The `MauticParagraphConnectorPluginBase` class will have a new configuration option for timeout.

Data model changes

No data model changes are required for this update.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇵🇱Poland jorgik

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024