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
We have a custom data object that extends SiteTree, we are also using the Blocks extension. This results in us being unable to add new instances of our custom data object under our own ModelAdmin because you cannot use GridFieldOrderableRows with an unsaved many to many collection as described in this open issue with gridfieldextension symbiote/silverstripe-gridfieldextensions#113. The issue does not effect new objects that are created via the Pages admin because in Pages admin, a new object is saved as a draft before the form is loaded but this is not the case if you use your own admin class. We get the following error in our logs:
[14-Dec-2016 14:07:34] Warning at gridfieldextensions/code/GridFieldOrderableRows.php line 146: Argument 1 passed to GridFieldOrderableRows::getSortTable() must be an instance of DataList, instance of UnsavedRelationList given, called in /var/www/html/gridfieldextensions/code/GridFieldOrderableRows.php on line 250 and defined (http://amadeus.dev:32821/admin/public-courses/PublicCourseOutline/EditForm/field/PublicCourseOutline/item/new)
IMO the blocks tab should not be loaded at all until the data object has been saved. We get around the issue by adding the following to our data object's getCMSFields:
if (!$this->isInDB()) {
$fields->removeFieldFromTab("Root", "Blocks");
}
However IMO the SiteTree extension should be checking this itself to properly address the issue. Will open a PR if I get a chance.
The text was updated successfully, but these errors were encountered:
We have a custom data object that extends SiteTree, we are also using the Blocks extension. This results in us being unable to add new instances of our custom data object under our own ModelAdmin because you cannot use GridFieldOrderableRows with an unsaved many to many collection as described in this open issue with gridfieldextension symbiote/silverstripe-gridfieldextensions#113. The issue does not effect new objects that are created via the Pages admin because in Pages admin, a new object is saved as a draft before the form is loaded but this is not the case if you use your own admin class. We get the following error in our logs:
IMO the blocks tab should not be loaded at all until the data object has been saved. We get around the issue by adding the following to our data object's getCMSFields:
However IMO the SiteTree extension should be checking this itself to properly address the issue. Will open a PR if I get a chance.
The text was updated successfully, but these errors were encountered: