Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-14797 - Error when moving a course to an empty category on Postgres

  • Loading branch information...
commit be074bc3e6ea7901b8261fdfeddb90d1dd576cc3 1 parent 0259eda
tjhunt authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  course/lib.php
View
2  course/lib.php
@@ -1847,7 +1847,7 @@ function move_courses ($courseids, $categoryid) {
// figure out a sortorder that we can use in the destination category
$sortorder = get_field_sql('SELECT MIN(sortorder)-1 AS min
FROM ' . $CFG->prefix . 'course WHERE category=' . $categoryid);
- if ($sortorder === false) {
+ if (is_null($sortorder) || $sortorder === false) {
// the category is empty
// rather than let the db default to 0
// set it to > 100 and avoid extra work in fix_coursesortorder()
Please sign in to comment.
Something went wrong with that request. Please try again.