Protect against endless loops in mollie webform

Created on 30 September 2022, over 2 years ago
Updated 26 July 2024, 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 review

Version

2.2

Component

Code

Created by

🇧🇪Belgium swentel

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

Merge Requests

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.71.5 2024