From e7b7cd2abe219de096f1a9b5fcb2704f427deebc Mon Sep 17 00:00:00 2001 From: git Date: Fri, 9 Jan 2015 09:59:29 +0100 Subject: [PATCH 1/2] Issue https://www.drupal.org/node/2402099 by drinkdecaf: H5P on Pantheon Environments --- h5p.classes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 5940e06..619463a 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1275,7 +1275,8 @@ class H5PStorage { } $destination_path = $libraries_path . DIRECTORY_SEPARATOR . H5PCore::libraryToString($library, TRUE); H5PCore::deleteFileTree($destination_path); - rename($library['uploadDirectory'], $destination_path); + $this->h5pC->copyFileTree($library['uploadDirectory'], $destination_path); + H5PCore::deleteFileTree($library['uploadDirectory']); $library_saved = TRUE; } From ae8609dd86084aa78b7d8d0c8f0b57840a414597 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 9 Jan 2015 10:00:40 +0100 Subject: [PATCH 2/2] Replaced another rename function. --- h5p.classes.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index 619463a..af50df5 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -412,13 +412,13 @@ interface H5PFrameworkInterface { * Start an atomic operation against the dependency storage */ public function lockDependencyStorage(); - + /** * Stops an atomic operation against the dependency storage */ public function unlockDependencyStorage(); - - + + /** * Delete a library from database and file system * @@ -1327,7 +1327,8 @@ class H5PStorage { // Move the content folder $destination_path = $contents_path . DIRECTORY_SEPARATOR . $contentId; - @rename($current_path, $destination_path); + $this->h5pC->copyFileTree($current_path, $destination_path); + H5PCore::deleteFileTree($current_path); // Save the content library dependencies $this->h5pF->saveLibraryUsage($contentId, $librariesInUse);