From f661248b5a85a39a1dff5b99c71c40b24a23b591 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Tue, 23 Oct 2018 13:15:55 +0200 Subject: [PATCH] HFP-2329 Skip emty metadata fields for h5p.json --- h5p.classes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 4e53fa3..b0099bc 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1647,7 +1647,7 @@ Class H5PExport { ); foreach(array('authors', 'source', 'license', 'licenseVersion', 'licenseExtras' ,'yearFrom', 'yearTo', 'changes', 'authorComments') as $field) { - if (isset($content['metadata'][$field])) { + if (isset($content['metadata'][$field]) && $content['metadata'][$field] !== '') { if (($field !== 'authors' && $field !== 'changes') || (count($content['metadata'][$field]) > 0)) { $h5pJson[$field] = json_decode(json_encode($content['metadata'][$field], TRUE)); }