Skip to content
Snippets Groups Projects
Unverified Commit f9c661fd authored by Thomas Marstrander's avatar Thomas Marstrander
Browse files

Fix error when uploading through legacy selector without metadata

parent e3e34004
No related branches found
No related tags found
No related merge requests found
......@@ -367,7 +367,11 @@ class mod_hvp_mod_form extends moodleform_mod {
unset($data->h5pparams);
if ($data->h5paction === 'upload') {
if (empty($data->metadata) || empty($data->metadata->title)) {
if (empty($data->metadata)) {
$data->metadata = new stdClass();
}
if (empty($data->metadata->title)) {
// Fix for legacy content upload to work.
// Fetch title from h5p.json or use a default string if not available.
$h5pvalidator = \mod_hvp\framework::instance('validator');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment