form : if the provided error for a field is not an array, use the default error class and use the value as message

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2698 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-04-15 15:08:27 +00:00
parent 3c98dd7c39
commit 5ad792d251

View File

@@ -182,7 +182,12 @@ class form
$field->values = $values[$field->name];
if (isset ($errors[$field->name]) &&
$errors[$field->name] !== "unset")
$field->errors = $errors[$field->name];
{
if (is_array ($errors[$field->name]))
$field->errors = $errors[$field->name];
else
$field->errors = array ("error", $errors[$field->name]);
}
$field->titlewidth = $this->titlewidth;
$field->fieldwidth = $this->fieldwidth;
$res .= $field->display ();