Protect against endless loops in mollie webform

Created on 30 September 2022, over 1 year ago
Updated 2 December 2023, 7 months ago

The following code block in MollieRedirectEventSubscriber.php can trigger endless loops:

    if (($isUpdated && !$confirmationUpdate) || $isLocked) {
      $this->messageManager->display(WebformMessageManagerInterface::SUBMISSION_UPDATED);
      return Url::fromRoute($routeName, $routeParameters, $routeOptions);
    }

This happens when you are setting up e-mail handlers with a condition when the payment status is set to paid, code that was introduced in #3206912: Mollie Webform: Mails only when paid β†’ . When mollie redirects, and the transaction subscriber has saved the submission, you end up in this block. However, at this point, the current route is someting like mollie/redirect/mollie_webform/{submissionid} and you end up being redirected to the same page, resulting in an endless loop.

Not sure what the best approach is here.

  • Remove the code block, and fall down to the exiting code to redirect (easiest I think)
  • Detect if current route is the redirect route and ignore this code block and rely on the existing code to redirect
  • Add a configure option for the user to select where to redirect to - seems a bit redundant and unnecessary
  • Other ideas?

This should probably go into 2.1.x as well.

πŸ“Œ Task
Status

Needs work

Version

2.2

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium swentel

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024