From 127dc4f0e1f9e88a12a33c07391355d8e28f7f9d Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 5 Apr 2016 16:06:09 +0200 Subject: [PATCH 1/2] Use correct ID when copying package --- h5p.classes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 23db57d..4badcc6 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1468,7 +1468,7 @@ class H5PStorage { * The main id of the new content (used in frameworks that support revisioning) */ public function copyPackage($contentId, $copyFromId, $contentMainId = NULL) { - $this->h5pC->fs->cloneContent($contentId, $newContentId); + $this->h5pC->fs->cloneContent($copyFromId, $contentId); $this->h5pF->copyLibraryUsage($contentId, $copyFromId, $contentMainId); } } From 7474916f3af4c83f3a72399f5642d0e8a9b6e27a Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 12 Apr 2016 11:37:55 +0200 Subject: [PATCH 2/2] scripts and styles arrays must always be defined --- h5p.classes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index 4badcc6..19f5fcb 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1971,9 +1971,9 @@ class H5PCore { // Get aggregated files for assets $key = self::getDependenciesHash($dependencies); - $files = $this->fs->getCachedAssets($key); - if ($files) { - return $files; // Using cached assets + $cachedAssets = $this->fs->getCachedAssets($key); + if ($cachedAssets !== NULL) { + return array_merge($files, $cachedAssets); // Using cached assets } }