Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On a gradebook page, I get this error:
user warning: 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 ') ORDER BY u.name ASC' at line 1 query: SELECT u.uid, u.name FROM users u INNER JOIN users_roles r ON u.uid = r.uid WHERE u.status != 0 AND r.rid IN () ORDER BY u.name ASC in /home/oadmin/public_html/thisisatest/includes/database.mysql.inc on line 120.
I don't know if this is my server, or the module itself.
Comments
Comment #1
rwohlebAt present, the gradebook uses site-wide roles to determine who is a student and who is a teacher. This code needs to be revamped to fit in line with the multi-gradebook support of the API. In the mean time, you can fix this error by assigning roles for students/teachers at 'admin/settings/gradebook'.
Thanks for catching this.
Comment #2
gmak CreditAttribution: gmak commentedI am seeing the same problem, even with roles defined in 'admin/settings/gradebook'.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedI got the same error as well, both before and after assigning roles. In fact, before I assigned roles, my name showed up on the gradebook page; after assigning roles, all I see is the error message.
Dan
Comment #4
boisebarbara CreditAttribution: boisebarbara commentedI've been playing around with the gradebook module, didn't realize how easy it was to install by just dumping the entire folder into the modules folder. I've played around with user roles, creating a role named student and another named teacher. I no longer get any error messages, but no gradebook appears when I click gradebook. I can enter a category, but no corresponding gradebook when I hit view. I would really like this feature in my drupal site, so any help is much appreciated.
Thanks,
Barbara
Comment #5
rwohlebThis SQL error should be fixed now.
Comment #6
rwohlebComment #7
(not verified) CreditAttribution: commentedComment #8
Eagle-i CreditAttribution: Eagle-i commentedI got to this post because i too have this issue. I downloaded and installed the module this week and everything seems to be installed fine: tables in database, modules activated.
When i click on gradebook from the side menu i get the following overview:
category Test category
possible 10
date 2007/01/01
title Test assignment
student 0 0/10
Clicking on any of the items is no problem but when i click on the clickable link "student" with underlying link "/gradebook/2", i get the MySql problem:
Location http://mysite.com/gradebook/2
Referrer http://mysite.com/gradebook
Message 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 n.status = 1 ORDER BY td.name ASC LIMIT 0, 10' at line 1 query: SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM node n INNER JOIN term_node tn ON n.nid = tn.nid INNER JOIN term_data td ON tn.tid = td.tid INNER JOIN gradebookapi_assignment a ON n.nid = a.nid WHERE tn.tid IN () AND n.status = 1 ORDER BY td.name ASC LIMIT 0, 10 in /home/mysite/public_html/includes/database.mysql.inc on line 121.
The resulting page was / is: (after the click that resulted in the error):
Home » gradebook
* view
* categories
* rebuild
category
possible
date
title
Did i miss anything? Maybe a code update or patch? Please help.