Skip to content

Commit

Permalink
Course MDL-22750 fixed sql query for reordering display using sortord…
Browse files Browse the repository at this point in the history
…er in course_categories.
  • Loading branch information
aparup committed Jun 14, 2010
1 parent 3ab2e35 commit e818c6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion course/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
if (!empty($moveup)) {
require_capability('moodle/category:manage', get_context_instance(CONTEXT_COURSECAT, $moveup));
if ($movecategory = $DB->get_record('course_categories', array('id'=>$moveup))) {
if ($swapcategory = $DB->get_records_select('course_categories', "sortorder<? AND parent=?", array($movecategory->sortorder, $movecategory->parent), 'sortorder ASC', '*', 0, 1)) {
if ($swapcategory = $DB->get_records_select('course_categories', "sortorder<? AND parent=?", array($movecategory->sortorder, $movecategory->parent), 'sortorder DESC', '*', 0, 1)) {
$swapcategory = reset($swapcategory);
}
}
Expand Down

0 comments on commit e818c6f

Please sign in to comment.