MDL-33554 update_categories didn't update the path field when moving category
authorJerome Mouneyrac <jerome@moodle.com>
Wed, 6 Jun 2012 08:40:06 +0000 (16:40 +0800)
committerJerome Mouneyrac <jerome@moodle.com>
Wed, 6 Jun 2012 08:40:06 +0000 (16:40 +0800)
course/externallib.php

index d02506f..5017145 100644 (file)
@@ -1372,6 +1372,9 @@ class core_course_external extends external_api {
                 // Finally move the category.
                 move_category($category, $parent_cat);
                 $category->parent = $cat['parent'];
+                // Get updated path by move_category().
+                $category->path = $DB->get_field('course_categories', 'path',
+                        array('id' => $category->id));
             }
             $DB->update_record('course_categories', $category);
         }