MDL-29773 use db debuginfo when file record insertion fails

This commit is contained in:
Petr Skoda
2011-10-16 16:52:01 +02:00
committed by Eloy Lafuente (stronk7)
parent 263c52843b
commit cfb15041cf
+3 -15
View File
@@ -669,12 +669,8 @@ class file_storage {
try {
$newrecord->id = $DB->insert_record('files', $newrecord);
} catch (dml_exception $e) {
$newrecord->id = false;
}
if (!$newrecord->id) {
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
$newrecord->filepath, $newrecord->filename);
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
}
$this->create_directory($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->userid);
@@ -814,15 +810,11 @@ class file_storage {
try {
$newrecord->id = $DB->insert_record('files', $newrecord);
} catch (dml_exception $e) {
$newrecord->id = false;
}
if (!$newrecord->id) {
if ($newfile) {
$this->deleted_file_cleanup($newrecord->contenthash);
}
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
$newrecord->filepath, $newrecord->filename);
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
}
$this->create_directory($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->userid);
@@ -907,15 +899,11 @@ class file_storage {
try {
$newrecord->id = $DB->insert_record('files', $newrecord);
} catch (dml_exception $e) {
$newrecord->id = false;
}
if (!$newrecord->id) {
if ($newfile) {
$this->deleted_file_cleanup($newrecord->contenthash);
}
throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid,
$newrecord->filepath, $newrecord->filename);
$newrecord->filepath, $newrecord->filename, $e->debuginfo);
}
$this->create_directory($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->userid);