HFP-2329 Skip emty metadata fields for h5p.json

semi-fullscreen
Paal Joergensen 2018-10-23 13:15:55 +02:00
parent 82b50fc2f1
commit f661248b5a
1 changed files with 1 additions and 1 deletions

View File

@ -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));
}