Avoid caching dependencies without assets

pull/17/head
Frode Petterson 2016-01-25 14:44:10 +01:00
parent 8597baa253
commit 5eb0e0e14c
1 changed files with 11 additions and 5 deletions

View File

@ -1939,6 +1939,17 @@ class H5PCore {
* @return array files. * @return array files.
*/ */
public function getDependenciesFiles($dependencies, $prefix = '') { public function getDependenciesFiles($dependencies, $prefix = '') {
// Build files list for assets
$files = array(
'scripts' => array(),
'styles' => array()
);
// Avoid caching empty files
if (empty($dependencies)) {
return $files;
}
if ($this->aggregateAssets) { if ($this->aggregateAssets) {
// Get aggregated files for assets // Get aggregated files for assets
$key = self::getDependenciesHash($dependencies); $key = self::getDependenciesHash($dependencies);
@ -1949,11 +1960,6 @@ class H5PCore {
} }
} }
// Build files list for assets
$files = array(
'scripts' => array(),
'styles' => array()
);
// Using content dependencies // Using content dependencies
foreach ($dependencies as $dependency) { foreach ($dependencies as $dependency) {
if (isset($dependency['path']) === FALSE) { if (isset($dependency['path']) === FALSE) {