Modal Does not Close Automatically (possibly only on multilingual sites)

Created on 10 March 2023, over 1 year ago
Updated 26 October 2023, 8 months ago

Problem/Motivation

After editing a block with Layout Builder using the iFrame Modal, clicking Save or Update does not close the modal or iframe but loads the changes inside of the modal iframe.

Steps to reproduce

Create or edit a block and save it

Proposed resolution

It looks like the change from 1.2.0 to 1.3.0 to /src/Render/MainContent/IframeRenderer.php from

$iframe_src->setOption('query', [
      'destination' => '/layout_builder_iframe_modal/redirect',
    ]);

to

$iframe_src->setOption('query', [
      'destination' => Url::fromRoute('layout_builder_iframe_modal.redirect')->toString(TRUE)->getGeneratedUrl(),
    ]);

may have caused this. When debugging this change, Url::fromRoute('layout_builder_iframe_modal.redirect')->toString(TRUE)->getGeneratedUrl() produces an absolute URL instead of a relative path, causing it to fail. I tried adding setAbsolute(FALSE) but it still created an absolute path.

πŸ› Bug report
Status

Needs review

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States themarkahrens

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

Comments & Activities

Production build 0.69.0 2024