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
ModelAsController is currently hardcoded to work with SiteTree. It's not uncommon to want to route to a DataObject that isn't managed in the site tree, and therefore isn't a SiteTree object - but for the frontend to treat it the same way it treats SiteTree objects.
Making this class more generic removes some friction from that use case.
Acceptance Criteria
Make this controller work with other DataObject subclasses
Add a config property for the default model class - or move that logic into a different class
This is needed for logic in RootURLController
If needed, remove assumptions that records will have the Versioned extension, or throw an exception if they don't.
If necessary, define an interface or add explicitly hasMethod()/hasField() checks, and throw exceptions if needed fields/methods aren't available
Either also make OldPageRedirector generic, or else only use it when SiteTree is the model being used.
TO DECIDE
Arguably this doesn't open much opportunity if we don't move some stuff around as well - but what should we move, and to where?
Do we want to move this to silverstripe/framework?
Do we want to move this to a new module (along with ContentController and RootURLController)?
Do we want to keep these here, and move SiteTree and CMSMain to a new silverstripe/pages module?
The text was updated successfully, but these errors were encountered:
ModelAsController
is currently hardcoded to work withSiteTree
. It's not uncommon to want to route to aDataObject
that isn't managed in the site tree, and therefore isn't aSiteTree
object - but for the frontend to treat it the same way it treatsSiteTree
objects.Making this class more generic removes some friction from that use case.
Acceptance Criteria
DataObject
subclassesRootURLController
Versioned
extension, or throw an exception if they don't.hasMethod()
/hasField()
checks, and throw exceptions if needed fields/methods aren't availableOldPageRedirector
generic, or else only use it whenSiteTree
is the model being used.TO DECIDE
Arguably this doesn't open much opportunity if we don't move some stuff around as well - but what should we move, and to where?
silverstripe/framework
?ContentController
andRootURLController
)?SiteTree
andCMSMain
to a newsilverstripe/pages
module?The text was updated successfully, but these errors were encountered: