Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-5670

get_courses_page function doesn't return the list of courses - is DISTINCT needed?

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: Course
    • Labels:
      None
    • Environment:
      Windows XP
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE

      Description

      When I view the list of courses per category on the /moodle/course/category.php page, it shows me no courses, even though I've added the courses to it before and i can see them on the front page.

      After looking at get_courses_page function, and running the generate SQL inside of mysql console I get the following error: #1037 - Out of memory; restart server and try again (needed 65528 bytes)

      The problem lies with the DISTICT keyword in the generated SQL statement (SELECT DISTINCT c.id,c.sortorder,c.shortname,c.fullname,c.summary,c.visible,c.teacher,c.guest,c.password FROM mdl_course c WHERE c.category = '4' ORDER BY c.sortorder ASC LIMIT 0,20), and after the removal of the statement, the SQL runs fine, with the correct number of courses displayed.

      MySQL version I am running is 5.0.18, php version 4.4.1 (Its the XAMP installation.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                7/Nov/06