mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Merge pull request #176 from creative-commoners/pulls/1/inline-submit
ENH Add MyFile to ElementContentExtension
This commit is contained in:
commit
3b2b4c6958
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace SilverStripe\FrameworkTest\Elemental\Extension;
|
namespace SilverStripe\FrameworkTest\Elemental\Extension;
|
||||||
|
|
||||||
|
use SilverStripe\Assets\File;
|
||||||
use SilverStripe\CMS\Model\SiteTree;
|
use SilverStripe\CMS\Model\SiteTree;
|
||||||
use SilverStripe\Core\Extension;
|
use SilverStripe\Core\Extension;
|
||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
||||||
@ -23,6 +24,7 @@ class ElementContentExtension extends Extension
|
|||||||
|
|
||||||
private static $has_one = [
|
private static $has_one = [
|
||||||
'MyPage' => SiteTree::class,
|
'MyPage' => SiteTree::class,
|
||||||
|
'MyFile' => File::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
public function validate(ValidationResult $result)
|
public function validate(ValidationResult $result)
|
||||||
@ -40,7 +42,7 @@ class ElementContentExtension extends Extension
|
|||||||
|
|
||||||
public function updateCMSCompositeValidator(CompositeValidator $compositeValidator)
|
public function updateCMSCompositeValidator(CompositeValidator $compositeValidator)
|
||||||
{
|
{
|
||||||
$compositeValidator->addValidator(new RequiredFields(['Title', 'MyPageID']));
|
$compositeValidator->addValidator(new RequiredFields(['Title', 'MyPageID', 'MyFile']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateCMSFields(FieldList $fields)
|
public function updateCMSFields(FieldList $fields)
|
||||||
|
Loading…
Reference in New Issue
Block a user