Skip to content
Browse files

MDL-37572 small bug fix with misplaced assignment

  • Loading branch information...
1 parent d220e90 commit 9d093b71afceb3bedd164e20a04e5695f9555955 @marinaglancy marinaglancy committed with samhemelryk
Showing with 2 additions and 2 deletions.
  1. +2 −2 course/manage.php
View
4 course/manage.php
@@ -174,11 +174,10 @@
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);
}
@@ -186,6 +185,7 @@
} 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.
Something went wrong with that request. Please try again.