Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-37572 small bug fix with misplaced assignment

  • Loading branch information...
commit 9d093b71afceb3bedd164e20a04e5695f9555955 1 parent d220e90
@marinaglancy marinaglancy authored samhemelryk committed
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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.