BUGFIX Fixed boundary PHP notice case in RequiredFields::php() where a field name may not be defined in the $data array when a Form is submitted

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110463 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-09-06 03:22:34 +00:00 committed by Sam Minnee
parent d566ac4292
commit 8bcfa7b715

View File

@ -103,11 +103,12 @@ JS;
$error = true;
// submitted data for file upload fields come back as an array
if(is_array($data[$fieldName])) {
$error = ($data[$fieldName]) ? false : true;
$value = isset($data[$fieldName]) ? $data[$fieldName] : null;
if(is_array($value)) {
$error = ($value) ? false : true;
} else {
// assume a string or integer
$error = (strlen($data[$fieldName])) ? false : true;
$error = (strlen($value)) ? false : true;
}
if($formField && $error) {