BUG: Do not add a default message for numeric and email fields

BUG: Corrected classname to use right object
This commit is contained in:
Kirk Mayo 2014-02-12 12:35:15 +13:00
parent 85c1f52c45
commit 0f647009fa

View File

@ -600,6 +600,10 @@ class UserDefinedForm_Controller extends Page_Controller {
if($this->Fields()) {
foreach($this->Fields() as $field) {
if (!in_array($field->ClassName, array('EditableEmailField', 'EditableNumericField'))) {
$messages[$field->Name] = $field->getErrorMessage()->HTML();
}
if($field->Required) {
$rules[$field->Name] = array_merge(array('required' => true), $field->getValidation());
$required->addRequiredField($field->Name);