mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-29708 Fixed file_exception() arguments in rename().
This commit is contained in:
parent
874db754ce
commit
6637cf27b9
1 changed files with 8 additions and 1 deletions
|
@ -205,7 +205,14 @@ class stored_file {
|
||||||
*/
|
*/
|
||||||
public function rename($filepath, $filename) {
|
public function rename($filepath, $filename) {
|
||||||
if ($this->fs->file_exists($this->get_contextid(), $this->get_component(), $this->get_filearea(), $this->get_itemid(), $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 = new stdClass;
|
||||||
$filerecord->filepath = $filepath;
|
$filerecord->filepath = $filepath;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue