mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
Merge branch 'dev_MDL-33147_transaction' of git://github.com/dongsheng/moodle
This commit is contained in:
commit
63f2813497
2 changed files with 14 additions and 0 deletions
|
@ -1260,6 +1260,8 @@ class file_storage {
|
|||
$filerecord->timemodified = $now;
|
||||
}
|
||||
|
||||
$transaction = $DB->start_delegated_transaction();
|
||||
|
||||
// Insert file reference record.
|
||||
try {
|
||||
$referencerecord = new stdClass;
|
||||
|
@ -1292,6 +1294,8 @@ class file_storage {
|
|||
|
||||
$this->create_directory($filerecord->contextid, $filerecord->component, $filerecord->filearea, $filerecord->itemid, $filerecord->filepath, $filerecord->userid);
|
||||
|
||||
$transaction->allow_commit();
|
||||
|
||||
// Adding repositoryid and reference to file record to create stored_file instance
|
||||
$filerecord->repositoryid = $repositoryid;
|
||||
$filerecord->reference = $reference;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue