mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Fix issue with Folder::validate() failing on allowed_extensions
This commit is contained in:
parent
8f26908b3b
commit
d2229ce8a6
@ -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;
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user