Avoid getting 'Invalid selected option in select' for existing content

semi-fullscreen
Paal Joergensen 2018-11-02 10:03:58 +01:00
parent 715fa6f803
commit 898d975921
1 changed files with 7 additions and 1 deletions

View File

@ -3402,8 +3402,14 @@ class H5PContentValidator {
*/
public function validateMetadata($metadata) {
$semantics = $this->getMetadataSemantics();
$group = (object)$metadata;
// Stop complaining about "invalid selected option in select" for
// old content without license chosen.
if (!isset($group->license)) {
$group->license = 'U';
}
$this->validateGroup($group, (object) array(
'type' => 'group',
'fields' => $semantics,