summaryrefslogtreecommitdiff
path: root/src/Manager
diff options
context:
space:
mode:
authorKreshnik Hasanaj <kreshnik.hasanaj@gmail.com>2022-11-24 13:20:44 +0100
committerGitHub <noreply@github.com>2022-11-24 13:20:44 +0100
commit812ddb30d182886ab6dc10dc5bb6deee221d2a02 (patch)
tree91a490ecc63b640e230b7db518092e628e1c0063 /src/Manager
parent15b98be732093dd7226205c8a7c08fe785f53165 (diff)
Fix: Move the deleteScormFolder() method call to the deleteScorm() method.
When calling the method ``` public function uploadScormArchive(UploadedFile $file, $uuid = null) ``` It calls within it the method: ``` private function saveScorm($file, $filename, $uuid = null) ``` Which calls the method: ``` private function generateScorm($file) ``` Which calls the `unzipper` method on the `scormDisk` object. The scorm path is cleared within the method body before the new content is made available. As `deleteScormData` is called further down in the `uploadScormArchive` method, all content is removed after a successful upload.
Diffstat (limited to 'src/Manager')
-rw-r--r--src/Manager/ScormManager.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Manager/ScormManager.php b/src/Manager/ScormManager.php
index d403d1e..c3b0e5f 100644
--- a/src/Manager/ScormManager.php
+++ b/src/Manager/ScormManager.php
@@ -267,6 +267,8 @@ class ScormManager
// Delete after the previous item is stored
if ($model) {
$this->deleteScormData($model);
+ // Delete folder from server
+ $this->deleteScormFolder($model->uuid);
$model->delete(); // delete scorm
}
}
@@ -281,8 +283,6 @@ class ScormManager
$oldSco->scoTrackings()->delete();
}
$model->scos()->delete(); // delete scos
- // Delete folder from server
- $this->deleteScormFolder($model->uuid);
}
/**