mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-60318 filestorage: Fixed undefined method move_to_trash()
This commit is contained in:
parent
23ab0d7788
commit
5ca85a1efe
1 changed files with 3 additions and 3 deletions
|
@ -1326,7 +1326,7 @@ class file_storage {
|
||||||
$this->create_file($newrecord);
|
$this->create_file($newrecord);
|
||||||
} catch (dml_exception $e) {
|
} catch (dml_exception $e) {
|
||||||
if ($newfile) {
|
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,
|
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
|
||||||
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
|
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
|
||||||
|
@ -1445,7 +1445,7 @@ class file_storage {
|
||||||
$this->create_file($newrecord);
|
$this->create_file($newrecord);
|
||||||
} catch (dml_exception $e) {
|
} catch (dml_exception $e) {
|
||||||
if ($newfile) {
|
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,
|
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
|
||||||
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
|
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
|
||||||
|
@ -1604,7 +1604,7 @@ class file_storage {
|
||||||
$filerecord->id = $DB->insert_record('files', $filerecord);
|
$filerecord->id = $DB->insert_record('files', $filerecord);
|
||||||
} catch (dml_exception $e) {
|
} catch (dml_exception $e) {
|
||||||
if (!empty($newfile)) {
|
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,
|
throw new stored_file_creation_exception($filerecord->contextid, $filerecord->component, $filerecord->filearea, $filerecord->itemid,
|
||||||
$filerecord->filepath, $filerecord->filename, $e->debuginfo);
|
$filerecord->filepath, $filerecord->filename, $e->debuginfo);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue