Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-27896 course - Rectified wrong use of itemid for preparing draft …

…file area
  • Loading branch information...
commit cec1d81461cf2e1ab7f31b90c7008217d81b77c4 1 parent dedb69a
Rajesh Taneja authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 course/editcategory.php
View
5 course/editcategory.php
@@ -13,6 +13,8 @@
require_login();
$id = optional_param('id', 0, PARAM_INT);
+$itemid = 0; //initalise itemid, as all files in category description has item id 0
+
if ($id) {
if (!$category = $DB->get_record('course_categories', array('id' => $id))) {
print_error('unknowcategory');
@@ -43,6 +45,7 @@
require_capability('moodle/category:manage', $context);
$strtitle = get_string("addnewcategory");
$editorcontext = $context;
+ $itemid = null; //set this explicitly, so files for parent category should not get loaded in draft area.
$title = "$SITE->shortname: ".get_string('addnewcategory');
$fullname = $SITE->fullname;
}
@@ -55,7 +58,7 @@
'trusttext' => true,
'context' => $editorcontext
);
-$category = file_prepare_standard_editor($category, 'description', $editoroptions, $editorcontext, 'coursecat', 'description', 0);
+$category = file_prepare_standard_editor($category, 'description', $editoroptions, $editorcontext, 'coursecat', 'description', $itemid);
$mform = new editcategory_form('editcategory.php', compact('category', 'editoroptions'));
$mform->set_data($category);
Please sign in to comment.
Something went wrong with that request. Please try again.