BUGFIX no Sort value applie to EditableOption on write

This commit is contained in:
muskie9 2016-07-21 01:08:03 -05:00
parent 3ec291fbef
commit 08646ad45e

View File

@ -114,4 +114,15 @@ class EditableOption extends DataObject {
public function canUnpublish($member = null) {
return $this->canDelete($member);
}
/**
*
*/
protected function onBeforeWrite() {
if (!$this->Sort) {
$this->Sort = EditableOption::get()->max('Sort') + 1;
}
parent::onBeforeWrite();
}
}