diff --git a/Assets/File.php b/Assets/File.php index 14add6cc9..6a5a6d2e5 100644 --- a/Assets/File.php +++ b/Assets/File.php @@ -997,7 +997,7 @@ class File extends DataObject implements ShortcodeHandler, AssetContainer, Thumb } public function validate() { - $result = new ValidationResult(); + $result = ValidationResult::create(); $this->File->validate($result, $this->Name); $this->extend('validate', $result); return $result; diff --git a/Assets/Folder.php b/Assets/Folder.php index a0aa413ee..c5a61d6c1 100644 --- a/Assets/Folder.php +++ b/Assets/Folder.php @@ -9,6 +9,7 @@ use SilverStripe\Forms\HiddenField; use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\TextField; use SilverStripe\ORM\DataList; +use SilverStripe\ORM\ValidationResult; use SilverStripe\ORM\Versioning\Versioned; /** @@ -325,4 +326,10 @@ class Folder extends File { public function StripThumbnail() { return null; } + + public function validate() { + $result = ValidationResult::create(); + $this->extend('validate', $result); + return $result; + } }