Issue Details (XML | Word | Printable)

Key: MDL-11418
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Tim Hunt
Reporter: Patrick Pollet
Votes: 5
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

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

Created: 24/Sep/07 01:41 AM   Updated: 15/Dec/08 11:53 AM
Component/s: Enrolments
Affects Version/s: 1.7.2
Fix Version/s: 1.7.7, 1.8.8, 1.9.4

Environment: any
Issue Links:
Duplicate
 

Participants: Patrick Pollet and Tim Hunt
Security Level: None
Resolved date: 15/Dec/08
Affected Branches: MOODLE_17_STABLE
Fixed Branches: MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
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 ...
 
      
 

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Tim Hunt added a comment - 15/Dec/08 11:53 AM
Thanks Patrick.