Save dependencies by library id instead of by machine_name and version

namespaces
Svein-Tore Griff With 2013-02-24 00:12:57 +01:00
parent f40302b8b6
commit 71763222e2
1 changed files with 12 additions and 0 deletions

View File

@ -675,6 +675,18 @@ class H5PStorage {
$this->h5pC->delTree($destination_path);
rename($current_path, $destination_path);
}
foreach ($this->h5pC->librariesJsonData as $key => &$library) {
// All libraries have been saved, we now save all the dependencies
if (isset($library['preloadedDependencies'])) {
$this->h5pF->saveLibraryDependencies($library['libraryId'], $library['preloadedDependencies'], 'preloaded');
}
if (isset($library['dynamicDependencies'])) {
$this->h5pF->saveLibraryDependencies($library['libraryId'], $library['dynamicDependencies'], 'dynamic');
}
if (isset($library['editorDependencies'])) {
$this->h5pF->saveLibraryDependencies($library['libraryId'], $library['editorDependencies'], 'editor');
}
}
$current_path = $this->h5pF->getUploadedH5pFolderPath() . DIRECTORY_SEPARATOR . 'content';
$destination_path = $this->h5pF->getH5pPath() . DIRECTORY_SEPARATOR . 'content' . DIRECTORY_SEPARATOR . $contentId;
rename($current_path, $destination_path);