silverstripe/silverstripe-elemental

CMS 4.12: Preview broken for nested element (ElementList) in elemental 4.10

Closed this issue · 1 comments

Previews for Elemental List module appear to be broken using Elemental 4.10.

When attempting to browse to a child element with the editor in split mode, the CMS redirects back to the page editor. Everything works fine in edit mode so it seems like the preview window is causing this somehow. If I successfully browse to the child element editor in Edit mode, and then switch to split or preview mode, the redirect happens then too.

Screen.Recording.2023-02-08.at.3.38.40.PM.mov

The preview URL for a top-level element looks like:
/new-content-page/?ElementalPreview=1988683919&stage=Stage&CMSPreview=1#e3

Preview url for a nested element looks like:
/new-content-page/?stage=Stage&CMSPreview=1#e3?ElementalPreview=1821505376#e4

But it get's redirected back to the page preview:
/new-content-page/?stage=Stage&CMSPreview=1

The nested Element has two sets of ?query and #anchor parameters in the URL, which seems broken. The problem was likely introduced in this commit: 24f6cde

Thanks @GuySartorelli for helping me identify this.

PRs

Fixed in 4.10.1