Saturday, May 16, 2026

Moodle course order - manual sorting option vanished

One of our Moodle instances had the manual sorting option for courses disappear, at server/course/management.php

ChatGPT gave some hallucinatory suggestions, Gemini via aistudio.google.com gave the first suggestion of removing pagination by using the dropdown to show all courses instead of only the first 20 - the number of courses had become 21. Even after doing this, the sorting option did not return. But once I added a dummy category and some dummy courses and then deleted them, the sorting option returned. Gemini said, "When you created the dummy category and dummy courses, and then deleted them,
you triggered a core Moodle background script called fix_course_sortorder()." So that has fixed it.

Reading up on this function, it looks like for very early versions, this function was also buggy - https://moodle.org/mod/forum/discuss.php?d=126896 - but in current versions, this seems to be rewritten, like in the current main branch.

No comments:

Post a Comment