Moodle bulk users bug

August 15, 2008 – 10:26

When going to the bulk user actions page with debugging turned on I found an error for one of our sites.

Notice:  Trying to get property of non-object in /usr/share/moodle/admin/user/lib.php on line 30

Notice:  Trying to get property of non-object in /usr/share/moodle/admin/user/lib.php on line 32
You have an error
in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'AND deleted 1' at line
1
SELECT COUNT(*) FROM mdl_user WHERE id<> AND deleted <> 1
  • line 686 of lib/dmllib.php: call to debugging()
  • line 379 of lib/dmllib.php: call to get_recordset_sql()
  • line 362 of lib/dmllib.php: call to count_records_sql()
  • line 32 of admin/user/lib.php: call to count_records_select()
  • line 30 of admin/user/user_bulk.php: call to get_selection_data()
You have an error
in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'AND deleted 1' at line
1
SELECT COUNT(*) FROM mdl_user WHERE id<> AND deleted <> 1
  • line 686 of lib/dmllib.php: call to debugging()
  • line 379 of lib/dmllib.php: call to get_recordset_sql()
  • line 362 of lib/dmllib.php: call to count_records_sql()
  • line 33 of admin/user/lib.php: call to count_records_select()
  • line 30 of admin/user/user_bulk.php: call to get_selection_data()
You have an error
in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'AND deleted 1 ORDER BY
fullname LIMIT 2000' at line 1
SELECT id,CONCAT(firstname,' ',lastname) AS fullname FROM mdl_user WHERE id<> AND deleted <> 1 ORDER BY fullname
  • line 686 of lib/dmllib.php: call to debugging()
  • line 609 of lib/dmllib.php: call to get_recordset_sql()
  • line 1062 of lib/dmllib.php: call to get_recordset_select()
  • line 37 of admin/user/lib.php: call to get_records_select_menu()
  • line 30 of admin/user/user_bulk.php: call to get_selection_data()

Searching bulk user actions problems on the Moodle forums, I found that it might have something to do with the guest user account; hunting for the guest user account.

SELECT deleted from mdl_user where username = 'guest';
+---------+
| deleted |
+---------+
|       1 |
+---------+
1 row in set (0.00 sec)
UPDATE mdl_user set deleted = 0 where username = 'guest';

And the problem was automagically fixed.

Sorry, comments for this entry are closed at this time.