Skip to content

Commit

Permalink
Merge branch 'm34_MDL-60318_Undefined_method_file_storage-move_to_tra…
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 9, 2017
2 parents eda8027 + 5ca85a1 commit 4c54ac2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/filestorage/file_storage.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4c54ac2

Please sign in to comment.