OPPG-413: Validator just got a little more annoying. Gives warning if mandatory fields are missing in group

namespaces
Frank Ronny Larsen 2013-07-09 10:10:32 +02:00
parent 6e99a052e2
commit a247ca470c
1 changed files with 8 additions and 0 deletions

View File

@ -1375,6 +1375,14 @@ class H5PContentValidator {
} }
} }
} }
foreach ($semantics->fields as $field) {
if (!(isset($field->optional) && $field->optional)) {
// Check if field is in group.
if (! property_exists($group, $field->name)) {
$this->h5pF->setErrorMessage($this->h5pF->t('No value given for mandatory field ' . $field->name));
}
}
}
} }
/** /**