Open mlewis-everley opened 6 years ago
I've confirmed the behavior as explained.
I'm not sure if this is a bug or the expected behavior. Looking asset-admin
and campaign-admin
both of them put their templates in an Includes
folder.
What's really confusing from the developer's point of view is the Controller will work correctly if you navigate to it, but not if you refresh the page.
Thanks for looking at this @maxime-rainville , From my discussions with @sminnee on slack, he was under the impression that the templates are currently in Includes
for backwards compatibility, but they should also work the same way in other folders. Maybe he can pop up here to clarify?
I am opening this after a conversation over in slack (https://silverstripe-users.slack.com/archives/C36U3BDHN/p1526820688000056).
When I create a custom admin interface (extending
LeftAndMain
, the GridFields inside the admin interface work as expected, and if I click one of the records I get taken to theGridFieldDetailForm
(as expected). If i then refresh the page, the view is lost, I just get a white screen with an emptyfieldset
.This can be resolved by moving the two templates into an Includes folder)
app/templates/App/Admin/Includes
.Basically (to replicate) I did the following:
app/templates/App/Admin/ScheduleAdmin_Content.ss
:app/templates/App/Admin/ScheduleAdmin_EditForm.ss
:<% include SilverStripe/Forms/Form %>
I spent about 3 hours trying to trace why the templates need to be in
Includes
and didn't really get anywhere. For some reason, when the page is refreshed, if the templates are in not inIncludes
SS just doesn't see them...@sminnee believed this might be a bug, the templates should not need to go in an
Includes
folder.