Skip to content

Commit

Permalink
MDL-15405: make itemid & filepath mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
scyrma committed Sep 2, 2008
1 parent c7ca878 commit a9bbec4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/file/file_storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,12 @@ public function mark_delete_candidate($contenthash) {
* @param int $draftfileid file id of the draft file
* @param object $context new context of the file
* @param string $filearea destination filearea
* @param int $itemid new itemid (if null, keeps current)
* @param string $filepath new file path (if null, keeps current)
* @param int $itemid new itemid
* @param string $filepath new file path
* @param string $filename new file name (if null, keeps current)
* @return new stored_file
*/
function move_to_final_destination($draftfileid, $context, $filearea, $itemid = null, $filepath = null, $filename = null) {
function move_to_final_destination($draftfileid, $context, $filearea, $itemid, $filepath, $filename = null) {

if (!$file = $this->get_file_by_id($draftfileid)) {
return false;
Expand All @@ -715,8 +715,8 @@ function move_to_final_destination($draftfileid, $context, $filearea, $itemid =
$newrecord = new object();
$newrecord->contextid = $context->id;
$newrecord->filearea = $filearea;
$newrecord->itemid = ($itemid ? $itemid : $params['itemid']);
$newrecord->filepath = ($filepath ? $filepath : $params['filepath']);
$newrecord->itemid = $itemid;
$newrecord->filepath = $filepath;
$newrecord->filename = ($filename ? $filename : $params['filename']);

$newrecord->timecreated = $file->get_timecreated();
Expand Down

0 comments on commit a9bbec4

Please sign in to comment.