-
Bug
-
Resolution: Fixed
-
Minor
-
1.7.2
-
None
-
any
-
MOODLE_17_STABLE
-
MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
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 ...
- is duplicated by
-
MDL-12202 Ambiguous reference to sortorder in the Flat file enrolment plug-in
-
- Closed
-