Getting this error when trying to revise a MC question. (Does not happen all the time -- I can't figure out the pattern, but just got it after going in to edit a question, making no changes, and then hitting save. I have also come across it when trying to change the font size on some answer choices.

PDOException: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound: SELECT MAX(weight) FROM {quiz_node_relationship} WHERE parent_vid = :parent_vid; Array ( ) in quiz_question_revision_actions_submit() (line 223 of /home/vsource4/www/www/sites/all/modules/quiz/question_types/quiz_question/quiz_question.pages.inc)

CommentFileSizeAuthor
#2 1536306-quiz-pdo-exception.patch1.08 KBklausi

Comments

dkliewer’s picture

I am getting the same error when updating an MC question. Basically you have to change anything (in my case I changed the correct answer).

klausi’s picture

Version: 7.x-4.0-alpha2 » 7.x-4.x-dev
Status: Active » Needs review
StatusFileSize
new1.08 KB

The error message says it all - the call to db_query() misses the named parameters that are used in the queries. Not sure that I'm inserting the right parameters here, please test.

Patch attached.

edboost’s picture

Klausi,

Thanks for this. It seems to work!
Clearly, those of us who are working with this module need more php sense than we have.
Will continue to test to see if anything strange comes up. But we do seem to be able to edit questions without an error now.

Thanks for the patch!

falcon’s picture

Status: Needs review » Fixed

Commited a version of the patch. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 6d9245e on 7.x-4.x, 7.x-5.x by falcon:
    Fixed #1536306 by edboost and falcon: PDOException when revising...

  • Commit 6d9245e on 7.x-4.x, 7.x-5.x, quiz-pages by falcon:
    Fixed #1536306 by edboost and falcon: PDOException when revising...

  • Commit 6d9245e on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 by falcon:
    Fixed #1536306 by edboost and falcon: PDOException when revising...

  • Commit 6d9245e on 7.x-4.x, 7.x-5.x, 2269219 by falcon:
    Fixed #1536306 by edboost and falcon: PDOException when revising...