mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merged from MOODLE_14_STABLE
Fixed upgrade bug that could show up in cases where: - installations with large numbers of courses in a category AND 'hidden' courses in those categories - where the database upgrade was performed while NOT in a logged-in-admin session fix_course_sortorder() would fail to guarantee the uniqueness of course,sortorder and the new unique index on that column would fail to be created. Sigh.
This commit is contained in:
parent
6c4149f5f4
commit
301045e472
1 changed files with 1 additions and 1 deletions
|
@ -2308,7 +2308,7 @@ function fix_course_sortorder($categoryid=0, $n=0, $safe=0) {
|
||||||
if ($count && ( $safe
|
if ($count && ( $safe
|
||||||
|| ($max-$min+1!=$count)
|
|| ($max-$min+1!=$count)
|
||||||
|| $min < 10 ) ) {
|
|| $min < 10 ) ) {
|
||||||
if ($courses = get_courses($categoryid, 'c.sortorder ASC', 'c.id,c.sortorder')) {
|
if ($courses = get_records_sql("SELECT c.id, c.sortorder FROM {$CFG->prefix}course c WHERE category=$categoryid ORDER BY c.sortorder ASC")) {
|
||||||
begin_sql();
|
begin_sql();
|
||||||
|
|
||||||
// find the ideal starting point
|
// find the ideal starting point
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue