]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15405: make itemid & filepath mandatory
authorscyrma <scyrma>
Tue, 2 Sep 2008 08:06:47 +0000 (08:06 +0000)
committerscyrma <scyrma>
Tue, 2 Sep 2008 08:06:47 +0000 (08:06 +0000)
lib/file/file_storage.php

index ab7f2f02fcd8350b9cf5b58eeeedd496e59879f9..c66636b5222c04e23aaa0538e653895f538d8ba1 100644 (file)
@@ -698,12 +698,12 @@ class file_storage {
      * @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;
@@ -715,8 +715,8 @@ class file_storage {
         $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();