silverstripe / silverstripe-elemental

Create pages in Silverstripe CMS using content blocks
http://dna.co.nz
BSD 3-Clause "New" or "Revised" License
110 stars 115 forks source link

IE11 uri gets duplicated when trying to edit an item #683

Closed ningensei closed 5 years ago

ningensei commented 5 years ago

Elemental Version: 4.1.0 SilverStripe Version: 4.4.0

The url is malformed when trying to edit an ElementalArea item.

This is what I get in chrome: /admin/pages/edit/EditForm/6/field/ElementalArea/item/2/edit

and this in IE11: /admin/pages/edit/show/admin/pages/edit/EditForm/6/field/ElementalArea/item/2/edit

robbieaverill commented 5 years ago

How do you edit the ElementalArea? Elemental doesn't give you a way to do this directly, per-se. It gives you the CMS area interface listing blocks etc, is that what you're referring to? If so, where does the URL come into play for that?

HJGreen commented 5 years ago

I have a similar issue with IE11, but only for Elements where $inline_editable = false

Elemental Version: 4.0.3 SilverStripe Framework/CMS Version: 4.4.1


Steps to reproduce:

Expected:

Actual:


The URL which returns a 404 is in the same format as reported originally by @ningensei. Comparing it to the expected URL, it appears there is an additional admin/pages/edit/show/ at the start of the path.

My hunch is that there is an issue in the JavaScript that handles the page navigation, however I don't see any errors logged in the console.

HJGreen commented 5 years ago

I've been debugging in IE's devtools and it seems the issue is due to relative/absolute URLs, and I've tracked it down to this line:

https://github.com/dnadesign/silverstripe-elemental/blob/47ee8710488f9819c98dbd6b5306bb1ac6797277/client/src/components/ElementEditor/Element.js#L148

Here the value of link is admin/pages/edit/EditForm/6/field/ElementalArea/item/2/edit

Chrome/Firefox seem to treat that as an absolute URL and replace the existing path. IE11 seems to treat it as a relative URL and only replaces the very last section of the current URL.

A naive solution would be prepending link with a forward slash so that it's always treated as an absolute URL, but I'm not sure whether that would have any consequences elsewhere.

brynwhyman commented 5 years ago

Given the report implies some blocks aren't editable through the UI for IE11, which is a supported browser, bumping this to critical

robbieaverill commented 5 years ago

Ah yep, easy to reproduce with a "Form block" which comes with dnadesign/silverstripe-elemental-userforms. Thanks.

robbieaverill commented 5 years ago

PR at #690

ScopeyNZ commented 5 years ago

Closed by #690