When deleting a quiz I got 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 'AND question.status = 1 ORDER BY weight' at line 7 query: SELECT DISTINCT question.nid, question.vid, question.type, nr.title, nr.body, nr.format, qnr.question_status, qnr.weight FROM node question INNER JOIN node_revisions nr ON question.nid = nr.nid LEFT JOIN quiz_node_relationship qnr ON nr.vid = qnr.child_vid AND qnr.parent_vid = 1811 AND qnr.question_status != 2 WHERE question.type IN ( 'long_answer','matching','multichoice','quiz_directions','scale','short_answer','truefalse' ) AND qnr.parent_vid = 1811 AND qnr.parent_nid = AND question.status = 1 ORDER BY weight in /Applications/MAMP/htdocs/drupal-6.13/sites/all/modules/quiz/quiz.module on line 2425.
It looks like the problem is in this section:
if (!is_null($quiz_vid)) {
$where_add[] = 'qnr.parent_vid = '. (int) $quiz_vid;
$where_add[] = 'qnr.parent_nid = '. $quiz->nid;
}
and that $quiz->nid is empty. This could be do to this line not loading correctly,
$quiz = node_load((int) arg(1));
I have to run now and can't debug it at the moment, but thought I should at least report it.
Comments
Comment #1
sivaji_ganesh_jojodae commentedI appreciate you for reporting this bug. The following change has fixed this bug for me
The same has been changed in all the function calls.
Marking this as fixed.