MDL-29708 Fixed file_exception() arguments in rename().

This commit is contained in:
Matteo Scaramuccia 2014-06-01 09:17:09 +02:00
parent ad3ade7681
commit 8436e8590f

View File

@ -205,7 +205,14 @@ class stored_file {
*/
public function rename($filepath, $filename) {
if ($this->fs->file_exists($this->get_contextid(), $this->get_component(), $this->get_filearea(), $this->get_itemid(), $filepath, $filename)) {
throw new file_exception('storedfilenotcreated', '', 'file exists, cannot rename');
$a = new stdClass();
$a->contextid = $this->get_contextid();
$a->component = $this->get_component();
$a->filearea = $this->get_filearea();
$a->itemid = $this->get_itemid();
$a->filepath = $filepath;
$a->filename = $filename;
throw new file_exception('storedfilenotcreated', $a, 'file exists, cannot rename');
}
$filerecord = new stdClass;
$filerecord->filepath = $filepath;