PDOException: SQLSTATE[42S22] When adding quiz content

Course Queries Syllabus Queries . 2 years ago

  0   2   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 5 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Write Your Comments or Explanations to Help Others



Tuteehub forum answer Answers (2)


profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I am trying to implement the quiz module on a new website and it's throwing the following error when attempting to add content > quiz. I believe the code I have was part of a feature I was trying to migrate over from a different website so I could retain the functionality involved with it, but it's proven to be less than compatible. (Going from Drupal Commons 7.50 to Plain Drupal with a demo theme built in 7.54).

Can someone interpret this error and point me in the right direction as to what the missing piece of the puzzle is here?

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.allow_change_blank' in 'field list': SELECT base.qnp_id AS qnp_id, base.vid AS vid, base.nid AS nid, base.uid AS uid, base.number_of_random_questions AS number_of_random_questions, base.max_score_for_random AS max_score_for_random, base.pass_rate AS pass_rate, base.summary_pass AS summary_pass, base.summary_pass_format AS summary_pass_format, base.summary_default AS summary_default, base.summary_default_format AS summary_default_format, base.randomization AS randomization, base.backwards_navigation AS backwards_navigation, base.keep_results AS keep_results, base.repeat_until_correct AS repeat_until_correct, base.quiz_open AS quiz_open, base.quiz_close AS quiz_close, base.takes AS takes, base.show_attempt_stats AS show_attempt_stats, base.time_limit AS time_limit, base.quiz_always AS quiz_always, base.time_left AS time_left, base.max_score AS max_score, base.allow_skipping AS allow_skipping, base.allow_resume AS allow_resume, base.allow_jumping AS allow_jumping, base.allow_change AS allow_change, base.allow_change_blank AS allow_change_blank, base.build_on_last AS build_on_last, base.show_passed AS show_passed, base.mark_doubtful AS mark_doubtful, base.review_options AS review_options, base.result_type AS result_type FROM {quiz_node_properties} base WHERE (base.vid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 351 ) in EntityAPIController->query() (line 187 of /Applications/AMPPS/www/example/docroot/profiles/cms/modules/contrib/entity/inc ludes/entity.controller.inc).

Here is how the process went:

  • I implemented an online training feature from our current website for the new one
  • It included syllabus and quiz content types, neither of which worked until I installed the Title module
  • Once Title was installed, I received a new error only when trying to create content type quiz:

EntityFieldQueryException: Unknown field: title_field in EntityFieldQuery->fieldOrderBy() (line 954 of /var/www/html/example/docroot/includes/entity.inc).

  • I updated the quiz from 7.x-5.0-alpha4+77-dev to 7.x-5.1 and all seemed well
  • I removed a quiz field field_syllabus_ref and recreated it a different way, to reference the title of the syllabus page in the quiz.
  • Now I get the error below unless the module is uninstalled. When it is uninstalled, I am still able to add quiz content but I get a different error instead after saving it.
0 views   0 shares
profilepic.png
manpreet 2 years ago

The error was somehow related to the UUID module, which couldn't be disabled without derailing the entire website. Here's how I fixed it.

  • uninstalled the feature that held the affected quiz module

    drush pm-disable drush pm-uninstall

  • uninstalled the quiz module and all the modules dependent on it:

    drush pm-disable quiz drush pm-uninstall quiz

  • moved the quiz module files to my temp backup outside the drupal root:

mv sites/all/modules/contrib/quiz ..//quiz

  • downloaded the quiz module fresh and reenabled it and all the dependent modules and reenabled the feature that contained it:

drush dl quiz

drush en quiz

That took care of this particular error.

Please note: I did not yet have any quiz data or content set up; this guideline is only safe for a dev environment. I have not tested it with any actual content or user data.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community