silverstripe-gridfield-betterbuttons
silverstripe-gridfield-betterbuttons copied to clipboard
onBeforeWrite() is not called by "Save and close"
The function onBeforeWrite() works on DataObject with "Save" but not with "Save and close". Is this problem already known?
Any updates on this? I have a Dataobject which is saving correctly with the "Save" button, but does not save correctly with "Save and close". The feature is a checkbox on manyManyExtra Fields, and the DO attempts to validate() that object by checking the value.
This is within a custom GridFieldDetailForm, so I worked around it by disabling BetterButtons specifically for that form:
public function getCMSFields(){
...
$myDataObject = singleton('MyDataObject');
//BetterButtons "Save and Close" doesn't work on this custom GridFieldDetailForm, so disable it
//see @link https://github.com/unclecheese/silverstripe-gridfield-betterbuttons/issues/139
$myDataObject->config()->better_buttons_enabled = false;
...