Skip to content

Commit

Permalink
Merge branch 'wip-mdl-42703-master' of https://github.com/deraadt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Nov 5, 2013
2 parents a80af8a + 2bec969 commit 97c7b8a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3426,19 +3426,19 @@ function course_change_sortorder_after_course($courseorid, $moveaftercourseid) {

if ((int)$moveaftercourseid === 0) {
// We've moving the course to the start of the queue.
$sql = 'SELECT c.sortorder
FROM {course} c
WHERE c.category = :categoryid
ORDER BY c.sortorder';
$sql = 'SELECT sortorder
FROM {course}
WHERE category = :categoryid
ORDER BY sortorder';
$params = array(
'categoryid' => $course->category
);
$sortorder = $DB->get_field_sql($sql, $params, IGNORE_MULTIPLE);

$sql = 'UPDATE {course} c
$sql = 'UPDATE {course}
SET sortorder = sortorder + 1
WHERE c.category = :categoryid
AND c.id <> :id';
WHERE category = :categoryid
AND id <> :id';
$params = array(
'categoryid' => $course->category,
'id' => $course->id,
Expand All @@ -3458,9 +3458,9 @@ function course_change_sortorder_after_course($courseorid, $moveaftercourseid) {
}
// Increment all courses in the same category that are ordered after the moveafter course.
// This makes a space for the course we're moving.
$sql = 'UPDATE {course} c
$sql = 'UPDATE {course}
SET sortorder = sortorder + 1
WHERE c.category = :categoryid
WHERE category = :categoryid
AND sortorder > :sortorder';
$params = array(
'categoryid' => $moveaftercourse->category,
Expand Down

0 comments on commit 97c7b8a

Please sign in to comment.