From f207c3be9b037ad770147a587341e1d122b1f466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20J=C3=B8rgensen?= Date: Tue, 23 Sep 2014 10:44:22 +0200 Subject: [PATCH] Setting language on export to 'und' if not defined --- h5p.classes.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 4a386a7..51ffcec 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1251,7 +1251,9 @@ Class H5PExport { // Build h5p.json $h5pJson = array ( 'title' => $content['title'], - 'language' => $content['language'], + // TODO - stop using 'und', this is not the preferred way. + // Either remove language from the json if not existing, or use "language": null + 'language' => isset($content['language']) ? $content['language'] : 'und', 'mainLibrary' => $content['library']['name'], 'embedTypes' => $embedTypes, );