Permalink
Browse files

enable validation to GenericDataAdmin form

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@40754 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 15d8a4b commit 23a2a465328e76c83e429de887a59a34156cdf78 Normann Lou committed Aug 23, 2007
Showing with 3 additions and 2 deletions.
  1. +3 −2 code/GenericDataAdmin.php
@@ -186,8 +186,9 @@ function getEditForm($id) {
if(!$actions->fieldByName('action_delete')) {
$actions->push(new FormAction('delete', 'Delete','ajaxAction-delete'));
}
- $form = new Form($this, "EditForm", $fields, $actions);
-
+
+ $required = (method_exists($genericData, getCMSRequiredField)) ? $genericData->getCMSRequiredField() : new RequiredFields();
+ $form = new Form($this, "EditForm", $fields, $actions, $required);
if($this->stat('data_type_extra')) {
foreach ($this->stat('data_type_extra') as $oneRelated) {
$oneExtra = $genericData-> $oneRelated();

0 comments on commit 23a2a46

Please sign in to comment.