BUG Fix issue with Folder::validate() failing on allowed_extensions

This commit is contained in:
Damian Mooyman 2016-09-08 18:07:34 +12:00
parent 8f26908b3b
commit d2229ce8a6
2 changed files with 8 additions and 1 deletions

View File

@ -997,7 +997,7 @@ class File extends DataObject implements ShortcodeHandler, AssetContainer, Thumb
} }
public function validate() { public function validate() {
$result = new ValidationResult(); $result = ValidationResult::create();
$this->File->validate($result, $this->Name); $this->File->validate($result, $this->Name);
$this->extend('validate', $result); $this->extend('validate', $result);
return $result; return $result;

View File

@ -9,6 +9,7 @@ use SilverStripe\Forms\HiddenField;
use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\LiteralField;
use SilverStripe\Forms\TextField; use SilverStripe\Forms\TextField;
use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataList;
use SilverStripe\ORM\ValidationResult;
use SilverStripe\ORM\Versioning\Versioned; use SilverStripe\ORM\Versioning\Versioned;
/** /**
@ -325,4 +326,10 @@ class Folder extends File {
public function StripThumbnail() { public function StripThumbnail() {
return null; return null;
} }
public function validate() {
$result = ValidationResult::create();
$this->extend('validate', $result);
return $result;
}
} }