From be44d1fac90492b1c2830db4e3c985791da96751 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 22 Aug 2014 11:39:15 +0200 Subject: [PATCH] Fixed so that filtered params can be stored in the contents table. --- h5p.classes.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index bf1b48d..7bf5cab 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1340,7 +1340,10 @@ class H5PCore { $content['id'] = $this->h5pF->insertContent($content, $contentMainId); } - $this->h5pF->cacheDel('parameters', $content['id']); + if (!isset($content['filtered'])) { + // TODO: Add filtered to all impl. and remove + $this->h5pF->cacheDel('parameters', $content['id']); + } return $content['id']; } @@ -1389,7 +1392,14 @@ class H5PCore { * @return Object NULL on failure. */ public function filterParameters($content) { - $params = $this->h5pF->cacheGet('parameters', $content['id']); + if (isset($content['filtered'])) { + $params = ($content['filtered'] === '' ? NULL : $content['filtered']); + } + else { + // TODO: Add filtered to all impl. and remove + $params = $this->h5pF->cacheGet('parameters', $content['id']); + } + if ($params !== NULL) { return $params; }