OPPG-413: Validator just got a little more annoying. Gives warning if mandatory fields are missing in group
parent
6e99a052e2
commit
a247ca470c
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue