Merge branch '4.0'

This commit is contained in:
Daniel Hensby 2016-09-23 17:27:15 +01:00
commit 54e6e9aeb5
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
2 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,8 @@ class EditableFormHeading extends EditableFormField
public function getFormField()
{
$labelField = new HeaderField($this->Name, $this->EscapedTitle, $this->Level);
$labelField = HeaderField::create($this->EscapedTitle)
->setHeadingLevel($this->Level);
$labelField->addExtraClass('FormHeading');
$labelField->setAttribute('data-id', $this->Name);
$this->doUpdateFormField($labelField);

View File

@ -162,7 +162,8 @@ class EditableOption extends DataObject
return $value;
}
protected function onBeforeWrite() {
protected function onBeforeWrite()
{
if (!$this->Sort) {
$this->Sort = EditableOption::get()->max('Sort') + 1;
}