Query parameters get lost in iframe URLs

Created on 2 July 2024, 2 months ago

Problem/Motivation

When opening a modal with custom URL parameters, the parameters are lost. This is caused by the following code in IframeRenderer::renderResponse:

    // Set the destination query parameter to our custom redirect route.
    $iframe_src->setOption('query', [
      'destination' => Url::fromRoute('layout_builder_iframe_modal.redirect')->toString(TRUE)->getGeneratedUrl(),
    ]);

Steps to reproduce

  1. Alter a link for a layout builder route and add a custom URL parameter.
  2. Observe the parameter getting lost in the iframe URL.

Proposed resolution

Change the code in IframeRenderer::renderResponse to add the destination parameter to the existing query parameters, instead of overwriting the entire query.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Needs review

Version

1.3

Component

Code

Created by

🇳🇱Netherlands seanB Netherlands

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