Modal Does not Close Automatically

Created on 10 March 2023, almost 2 years 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

Active

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024