From 2289c0e43dfa31faad4954914d26dcca1b2891fe Mon Sep 17 00:00:00 2001 From: dongsheng Date: Fri, 11 Sep 2009 03:24:51 +0000 Subject: [PATCH] "MDL-16697, fixed itemid in filepicker" --- lib/form/filepicker.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/form/filepicker.php b/lib/form/filepicker.php index f5dc39a72f..8580ff498d 100644 --- a/lib/form/filepicker.php +++ b/lib/form/filepicker.php @@ -82,6 +82,10 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input { $currentfile = $file->get_filename(); $draftvalue = 'value="'.$draftitemid.'"'; } + } else { + // no existing area info provided - let's use fresh new draft area + $this->setValue(file_get_unused_draft_itemid()); + $draftitemid = $this->getValue(); } if ($COURSE->id == SITEID) { $context = get_context_instance(CONTEXT_SYSTEM); -- 2.39.5