I have got an errors

PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" LINE 2: WHERE result_id IN ('') ^: SELECT result_id, question_nid, question_vid FROM {quiz_node_results_answers} WHERE result_id IN (:result_id_0); Array ( [:result_id_0] => ) в функции quiz_delete_results() (строка 3969 в файле /var/www/drupal-7.2/sites/quiz.bashlov.ru/modules/contrib/quiz/quiz.module).

I try to uderstand why and put the code

function quiz_delete_results($rids) {
  if (empty($rids)) {
    return;
  }

  var_dump($rids);

var_dump return to screen -
array(1) { [0]=> bool(false) }

Comments

sivaji_ganesh_jojodae’s picture

array(1) { [0]=> bool(false) } is not a good sign, could you tell us what triggers this error. Deleting quiz node, user account or results from node/%node/results page ?

dema502’s picture

I've installed fresh drupal and quiz to test.
Create quiz and questions and then request page node/1/take

sivaji_ganesh_jojodae’s picture

Title: Postgres && take a test » PDOException when the quiz result save option is the newest or the best
Status: Active » Fixed

Yes I reproduce the PDOException when the quiz results save option is newest or the best (default all). I have committed a fix for the same to git, ref id d0f220d..8818f53.

dema502’s picture

I apply your patch but this error is still live.

Sorry. I've got another error in url node/1/results

PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "u.name" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT u.name, qnrs.uid, qnrs.result_id, qnrs.score, qnrs.is... ^: SELECT u.name, qnrs.uid, qnrs.result_id, qnrs.score, qnrs.is_evaluated AS evaluated, qnrs.time_start as started, qnrs.time_end as finished, qnp.pass_rate, qnrs.time_end - qnrs.time_start as duration FROM {quiz_node_results} qnrs LEFT JOIN {users} u ON u.uid = qnrs.uid LEFT JOIN {quiz_node_properties} qnp ON qnrs.vid = qnp.vid INNER JOIN ( SELECT qnrs.uid, MAX(qnrs.score) AS top_score FROM {quiz_node_results} qnrs LEFT JOIN {users} u ON u.uid = qnrs.uid LEFT JOIN {quiz_node_properties} qnp ON qnrs.vid = qnp.vid WHERE qnrs.nid = :quiz_nid AND time_end <> 0 GROUP BY qnrs.uid ) AS qnrc ON qnrs.uid = qnrc.uid AND qnrs.score = qnrc.top_score WHERE qnrs.nid = :quiz_nid AND time_end <> 0 GROUP BY qnrs.uid; Array ( [:quiz_nid] => 1 ) in function _quiz_results_mr_data_provider() (line 2272 в файле /var/www/***/modules/contrib/quiz/quiz.admin.inc).
sivaji_ganesh_jojodae’s picture

Status: Fixed » Active

I'm not sure why the error persists in your site, I couldn't guess anything unless I reproduce it myself. Regarding the new PDOException I guess I know the problem could be the global variable $db_type which no longer exists in d7 and replaced by db_driver(). I fixed that in commit 2c4e5f0..6c330a6.

sivaji_ganesh_jojodae’s picture

Tagging.

Satori42’s picture

Similar error. Fresh Drupal install, Quiz and User Points only installed. User Points activated for this sample quiz. On Finish-ing the quiz, Drupal returns a similar error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.taxonomy_term_node' doesn't exist: SELECT tid FROM {taxonomy_term_node} WHERE nid = :nid AND vid = :vid AND tid IN ( SELECT tid FROM {taxonomy_term_data} WHERE vid = :vid ); Array ( [:nid] => 1 [:vid] => 2 ) in quiz_quiz_finished() (line 2340 of C:\xampplite\htdocs\drupal\modules\quiz\quiz.module).

Status Report also returns the following:

    Notice: Undefined variable: node in QuizQuestion->viewCanRevealCorrect() (line 611 of C:\xampplite\htdocs\drupal\modules\quiz\question_types\quiz_question\quiz_question.core.inc).
    Notice: Undefined variable: node in QuizQuestion->viewCanRevealCorrect() (line 611 of C:\xampplite\htdocs\drupal\modules\quiz\question_types\quiz_question\quiz_question.core.inc).
    Notice: Undefined variable: node in QuizQuestion->viewCanRevealCorrect() (line 611 of C:\xampplite\htdocs\drupal\modules\quiz\question_types\quiz_question\quiz_question.core.inc).
Sabareesh’s picture

Hi, I cloned the recent version of the quiz module from the git. I tried to reproduce the same PDO exception in my site. I went on to take my sample quiz questions and visited the page node/%node/take. But i found no such errors being reported.
It would be great if you can take your time in checking the integrity of the latest git version. I can assure you that no such exceptions arises in the latest version of the quiz module.

falcon’s picture

Status: Active » Closed (cannot reproduce)
liam morland’s picture

Issue tags: +PostgreSQL

Tagging

  • Commit 8818f53 on 7.x-4.x, 7.x-5.x by sivaji:
    #1270680 PDOException when the quiz result save option is the newest or...

  • Commit 8818f53 on 7.x-4.x, 7.x-5.x, quiz-pages by sivaji:
    #1270680 PDOException when the quiz result save option is the newest or...

  • Commit 8818f53 on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 by sivaji:
    #1270680 PDOException when the quiz result save option is the newest or...

  • Commit 8818f53 on 7.x-4.x, 7.x-5.x, 2269219 by sivaji:
    #1270680 PDOException when the quiz result save option is the newest or...