mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUGFIX no Sort value applie to EditableOption on write
This commit is contained in:
parent
3ec291fbef
commit
08646ad45e
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user