Skip to content
Permalink
Browse files

MDL-60318 filestorage: Fixed undefined method move_to_trash()

  • Loading branch information...
scara committed Oct 2, 2017
1 parent 23ab0d7 commit 5ca85a1efe7fcab9c989567169506ee4829c2e89
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/filestorage/file_storage.php
@@ -1326,7 +1326,7 @@ public function create_file_from_pathname($filerecord, $pathname) {
$this->create_file($newrecord);
} catch (dml_exception $e) {
if ($newfile) {
$this->move_to_trash($newrecord->contenthash);
$this->filesystem->remove_file($newrecord->contenthash);
}
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
@@ -1445,7 +1445,7 @@ public function create_file_from_string($filerecord, $content) {
$this->create_file($newrecord);
} catch (dml_exception $e) {
if ($newfile) {
$this->move_to_trash($newrecord->contenthash);
$this->filesystem->remove_file($newrecord->contenthash);
}
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
@@ -1604,7 +1604,7 @@ public function create_file_from_reference($filerecord, $repositoryid, $referenc
$filerecord->id = $DB->insert_record('files', $filerecord);
} catch (dml_exception $e) {
if (!empty($newfile)) {
$this->move_to_trash($filerecord->contenthash);
$this->filesystem->remove_file($filerecord->contenthash);
}
throw new stored_file_creation_exception($filerecord->contextid, $filerecord->component, $filerecord->filearea, $filerecord->itemid,
$filerecord->filepath, $filerecord->filename, $e->debuginfo);

0 comments on commit 5ca85a1

Please sign in to comment.
You can’t perform that action at this time.