mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
Merge pull request #496 from muskie9/bugfix/#492
BUGFIX no Sort value applie to EditableOption on write
This commit is contained in:
commit
ca2a6a3e99
@ -114,4 +114,15 @@ class EditableOption extends DataObject {
|
|||||||
public function canUnpublish($member = null) {
|
public function canUnpublish($member = null) {
|
||||||
return $this->canDelete($member);
|
return $this->canDelete($member);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function onBeforeWrite() {
|
||||||
|
if (!$this->Sort) {
|
||||||
|
$this->Sort = EditableOption::get()->max('Sort') + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::onBeforeWrite();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user