Permalink
Browse files

MDL-37572 small bug fix with misplaced assignment

  • Loading branch information...
marinaglancy authored and Sam Hemelryk committed Feb 7, 2013
1 parent d220e90 commit 9d093b71afceb3bedd164e20a04e5695f9555955
Showing with 2 additions and 2 deletions.
  1. +2 −2 course/manage.php
View
@@ -174,18 +174,18 @@
fix_course_sortorder();
$swapcategory = null;
- $params = array($movecategory->sortorder, $movecategory->parent);
-
if (!empty($moveupcat)) {
require_capability('moodle/category:manage', context_coursecat::instance($moveupcat));
if ($movecategory = $DB->get_record('course_categories', array('id' => $moveupcat))) {
+ $params = array($movecategory->sortorder, $movecategory->parent);
if ($swapcategory = $DB->get_records_select('course_categories', "sortorder<? AND parent=?", $params, 'sortorder DESC', '*', 0, 1)) {
$swapcategory = reset($swapcategory);
}
}
} else {
require_capability('moodle/category:manage', context_coursecat::instance($movedowncat));
if ($movecategory = $DB->get_record('course_categories', array('id' => $movedowncat))) {
+ $params = array($movecategory->sortorder, $movecategory->parent);
if ($swapcategory = $DB->get_records_select('course_categories', "sortorder>? AND parent=?", $params, 'sortorder ASC', '*', 0, 1)) {
$swapcategory = reset($swapcategory);
}

0 comments on commit 9d093b7

Please sign in to comment.