Moodle

Not all courses are listed in a category

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.6
  • Fix Version/s: None
  • Component/s: Course
  • Labels:
    None
  • Environment:
    LINUX, PHP, POSTGRES

Description

Only 11 courses are listed in a category without any link to see the rest of courses. The only way to see a course is to search for it.

Activity

Hide
Tony Butler added a comment -

I have this exact same issue - just in this one category as far as I can tell: http://moodle.blackpool.ac.uk/course/category.php?id=227.
This category contains 14 courses and only the first 11 are displayed. This is very weird - here's what I've observed so far:

  • Admins and creators see all courses, but so do casual unauthenticated visitors!! Only ordinary logged-in users (including the 'guest' account) suffer this problem.
  • It seems to be dependent on sortorder - if I move courses up and down and change nothing else, it's always the bottom 3 courses that can't be seen (needless to say I've checked to make sure all courses are visible, currently available for enrolment etc.)
  • I have even tried creating a new category with the same name, moving the courses into it and deleting the original - but the new category suffers the same problem.
  • The key to this seems to be something to do with when the courses were created (possibly their id?). Of the 14 courses, 12 were created early on (ids of 300-ish, when we were on Moodle 1.5.x) and the last 2 were created very recently (ids of 1200+, with Moodle 1.6.x). The problem only occurs when BOTH of these new courses are present in the category, AND at least 1 of them is among the first 10 courses listed - if I move just one of them out of the category, or if they are both among the bottom 4 courses, the problem goes away!
Show
Tony Butler added a comment - I have this exact same issue - just in this one category as far as I can tell: http://moodle.blackpool.ac.uk/course/category.php?id=227. This category contains 14 courses and only the first 11 are displayed. This is very weird - here's what I've observed so far:
  • Admins and creators see all courses, but so do casual unauthenticated visitors!! Only ordinary logged-in users (including the 'guest' account) suffer this problem.
  • It seems to be dependent on sortorder - if I move courses up and down and change nothing else, it's always the bottom 3 courses that can't be seen (needless to say I've checked to make sure all courses are visible, currently available for enrolment etc.)
  • I have even tried creating a new category with the same name, moving the courses into it and deleting the original - but the new category suffers the same problem.
  • The key to this seems to be something to do with when the courses were created (possibly their id?). Of the 14 courses, 12 were created early on (ids of 300-ish, when we were on Moodle 1.5.x) and the last 2 were created very recently (ids of 1200+, with Moodle 1.6.x). The problem only occurs when BOTH of these new courses are present in the category, AND at least 1 of them is among the first 10 courses listed - if I move just one of them out of the category, or if they are both among the bottom 4 courses, the problem goes away!
Hide
Paul Menchini added a comment -

I also have this problem running 1.6.1. I have a category that contains 25 courses, 5 of which are hidden. An administrative user sees all 25. (Since the page count is 20, 20 courses are displayed on the first page and the remaining 5 on the 2nd page.)

However, a non-administrative user sees only the first 15 non-hidden courses.

I've collected some data about the origin of the problem: category.php calls datalib.php:get_courses_page(), which in turn calls datalib.php:get_records_sql(). I believe, based on manual db queries, that get_records_sql is working correctly until it calls datalib.php:recordset_to_array().

With a non-administrative user and the problematic course category, recordset_to_array.$rs->RecordCount() is 20 at the beginning of the function (as it should be), but count(recordset_to_array.$objects) == 15.

It appears that the $rs0>GetAssoc(true) function goes amiss.

This is as far as I've gotten--I wanted to see if the bug had already been fixed before delving further. Since it appears that the problem is open, I'll continue delving....

Show
Paul Menchini added a comment - I also have this problem running 1.6.1. I have a category that contains 25 courses, 5 of which are hidden. An administrative user sees all 25. (Since the page count is 20, 20 courses are displayed on the first page and the remaining 5 on the 2nd page.) However, a non-administrative user sees only the first 15 non-hidden courses. I've collected some data about the origin of the problem: category.php calls datalib.php:get_courses_page(), which in turn calls datalib.php:get_records_sql(). I believe, based on manual db queries, that get_records_sql is working correctly until it calls datalib.php:recordset_to_array(). With a non-administrative user and the problematic course category, recordset_to_array.$rs->RecordCount() is 20 at the beginning of the function (as it should be), but count(recordset_to_array.$objects) == 15. It appears that the $rs0>GetAssoc(true) function goes amiss. This is as far as I've gotten--I wanted to see if the bug had already been fixed before delving further. Since it appears that the problem is open, I'll continue delving....
Hide
Pieterjan Heyse added a comment -

I have updated one of my moodle's to Moodle 1.6.5 + (2006050550) yesterday and can confirm that this problem still exists, is there a fix for this version out there?

Show
Pieterjan Heyse added a comment - I have updated one of my moodle's to Moodle 1.6.5 + (2006050550) yesterday and can confirm that this problem still exists, is there a fix for this version out there?
Hide
Emma added a comment -

We are using Moodle 1.6 + and have discovered the same problem here (Eastleigh College) today. There are some course pages which are invisible for students but visible for administrators.

Show
Emma added a comment - We are using Moodle 1.6 + and have discovered the same problem here (Eastleigh College) today. There are some course pages which are invisible for students but visible for administrators.

People

Vote (3)
Watch (4)

Dates

  • Created:
    Updated: