Fixed so that filtered params can be stored in the contents table.

namespaces
Frode Petterson 2014-08-22 11:39:15 +02:00
parent 1da58ef039
commit be44d1fac9
1 changed files with 12 additions and 2 deletions

View File

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