]> git.mjollnir.org Git - moodle.git/commitdiff
workshop submission: fixed error preventing to submit at MySQL server
authorDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:25:13 +0000 (18:25 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:25:13 +0000 (18:25 +0000)
mod/workshop/submission.php

index e04150ce045bf27a3c4fcdd8d929cacba2675a03..cadeeb4a09e3867d272aa9349f7bfc0074fd18d7 100644 (file)
@@ -109,6 +109,10 @@ if ($edit and $ownsubmission) {
                                                       'workshop_submission_content', $formdata->id);
         $formdata = file_postupdate_standard_filemanager($formdata, 'attachment', $attachmentopts, $workshop->context,
                                                            'workshop_submission_attachment', $formdata->id);
+        if (empty($formdata->attachment)) {
+            // explicit cas to zero integer
+            $formdata->attachment = 0;
+        }
         // store the updated values or re-save the new submission (re-saving needed because URLs are now rewritten)
         $DB->update_record('workshop_submissions', $formdata);
         redirect($workshop->submission_url($formdata->id));