You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I have a page on a Subsite (not Main) and there is a Page on Main with the same ID like my Element, I cannot save, cause LeftAndMainSubsites extensions wants to redirect to that page on Main.
Saving works when not inline editable or with any element with an ID that does not fit to an ID of a Page on Main.
How to reproduce
Make a new project with SS5, Elemental, Subsites.
Create a new subsite
Create a Page on the new Subsite and an Element. The Element should have e.g. ID1 which corresponds to a Page on Main
Try to save; check network tab in webdev; it returns a 200 and a blank response; in the answer of the request should be a redirect like
To fix this nasty bug, I added the following configuration:
#hacky fix for getting elemental to work with subsites
DNADesign\Elemental\Controllers\ElementalAreaController:
tree_class: DNADesign\Elemental\Models\BaseElement
This makes CMSMain controller getRecord() look for an Element instead of a Page
Note: Another possibility (maybe even cleaner) would be to overwrite getRecord() in ElementalAreaController...
Module version(s) affected
5.3.6
Description
Silverstripe 5.3.0, Elemental 5.3.6, Subsites 3.3.0
When I have a page on a Subsite (not Main) and there is a Page on Main with the same ID like my Element, I cannot save, cause LeftAndMainSubsites extensions wants to redirect to that page on Main.
Saving works when not inline editable or with any element with an ID that does not fit to an ID of a Page on Main.
How to reproduce
Make a new project with SS5, Elemental, Subsites.
Create a new subsite
Create a Page on the new Subsite and an Element. The Element should have e.g. ID1 which corresponds to a Page on Main
Try to save; check network tab in webdev; it returns a 200 and a blank response; in the answer of the request should be a redirect like
Possible Solution
To fix this nasty bug, I added the following configuration:
This makes CMSMain controller getRecord() look for an Element instead of a Page
Note: Another possibility (maybe even cleaner) would be to overwrite
getRecord()
in ElementalAreaController...Additional Context
CC to @adiwidjaja
Validations
silverstripe/installer
(with any code examples you've provided)The text was updated successfully, but these errors were encountered: