Merge branch 'MDL-60105_master' of git://github.com/dmonllao/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2017-09-19 01:55:12 +02:00
commit db7083c4c4
2 changed files with 5 additions and 3 deletions

View File

@ -61,11 +61,11 @@ if ($mform->is_cancelled()) {
} else if ($formdata = $mform->get_data()) {
$formdata = file_postupdate_standard_filemanager($formdata, 'files', $options, $context, 'mod_folder', 'content', 0);
$DB->set_field('folder', 'revision', $folder->revision+1, array('id'=>$folder->id));
// Update the variable of the folder revision so we can pass it as an accurate snapshot later.
$folder->timemodified = time();
$folder->revision = $folder->revision + 1;
$DB->update_record('folder', $folder);
$params = array(
'context' => $context,
'objectid' => $folder->id

View File

@ -231,6 +231,8 @@ class document implements \renderable, \templatable {
if ($file = $fs->get_file_by_id($id)) {
$this->files[$id] = $file;
} else {
unset($this->files[$id]); // Index is out of date and referencing a file that does not exist.
}
}
}