Redirect failure on confirmation page

Created on 8 June 2022, about 2 years ago
Updated 3 June 2023, about 1 year ago

Problem/Motivation

Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.

I ran into this specific error via a Webform confirmation page redirect. While debugging the error I found that it was trying to load http://example.commyform/confirmation?token=something instead of http://example.com/myform/confirmation?token=something, so somewhere in the system it's loosing the leading slash on the page path.

Steps to reproduce

Configure the site's trusted hosts as follows:

  $settings['trusted_host_patterns'][] = '.*';

Set a form to use a page as the confirmation response.

Proposed resolution

Either work out documentation to avoid the problem, or a fix for the problem, depending on where the problem lies.

Remaining tasks

Work out the cause.

User interface changes

TBD

API changes

TBD

Data model changes

TBD

πŸ› Bug report
Status

Closed: works as designed

Version

6.1

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

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.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA
  • πŸ‡ΊπŸ‡ΈUnited States johne

    I finally found out what was causing this. We had default_page_base_path: set to "form". The correct value would be "/form". On the module's configuration page, this is labelled "Default base path for webform URLs".

    To fix this I needed to delete the broken aliases, update this value for the webform module and finally resave any related webforms.
    It looks like webform_update_8606() tried to address this, but only in one isolation case.

    Hopefully this helps someone else struggling with a similar situation.

Production build 0.69.0 2024