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

flatfile enrolment gives a warning in apache logs and do not collect teacher's mails

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.2
    • 1.7.7, 1.8.8, 1.9.4
    • Enrolments
    • None
    • any
    • MOODLE_17_STABLE
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      When using flatfile enrolment I noticed a lot of warnings in apache 's log (one for every student) as follows :

      [Sun Sep 23 00:45:02 2007] [error] [client 127.0.0.1] SQL Column 'sortorder' in order clause is ambiguous in /var/www
      /html/moodle172/lib/dmllib.php on line 886. STATEMENT:   SELECT u.*,ra.hidden FROM mdl_user u\n                INNER
      JOIN mdl_role_assignments ra ON ra.userid = u.id\n                INNER JOIN mdl_role r ON r.id = ra.roleid\n
              LEFT OUTER JOIN mdl_user_lastaccess ul ON (ul.userid = u.id AND ul.courseid = 59)\n                 WHERE ra.
      contextid  IN (65,3,1)\n                  AND u.deleted = 0\n                  AND ra.roleid in (1,3)\n
              \n                       ORDER BY sortorder ASC  with limits (, )

      This is due to the SQL in line 204 of enrol/flatfile/enrol.php that use column 'sortorder' that is defined in both mdl_role and mdl_role_assignaments.

      if ( empty($elog) and ($fields[0] == "add") ) {
      if ($fields[1] == "student") {
      if ($teachers = get_users_by_capability($context, 'moodle/course:update', 'u.*,ra.hidden', 'sortorder ASC')) {
      I changed it to
      if ($teachers = get_users_by_capability($context, 'moodle/course:update', 'u.*,ra.hidden', 'ra.sortorder ASC'))

      Cheers

      I peeked into 1.82 code and the line 204 is the same, so I guess latest Moodle still gives these warnings ...

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              ppollet Patrick Pollet
              Nobody Nobody
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
              Votes:
              5 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                28/Jan/09