Noticed that the update hook doesn't take into account if the field doesn't exist.

CommentFileSizeAuthor
#2 2867593-2.patch418 bytesjoelpittet

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

StatusFileSize
new418 bytes
joelpittet’s picture

Status: Active » Needs review

  • djdevin committed e4c7e06 on 7.x-5.x authored by joelpittet
    Issue #2867593 by joelpittet: Add conditional around update hook...
djdevin’s picture

Status: Needs review » Fixed

Thanks. Fixed! I wasn't able to reproduce but there is probably some situation where that field does not exist, given the rapid schema changes that happened between 4 and 5.x stable.

joelpittet’s picture

Thanks, doesn't hurt though my actual problem looked more related to entity controller being loaded due to that update which complained that the tid didn't exist... but I don't know how to resolve that besides doing a registry rebuild.

WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.tid' 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,                  [error]
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.tid AS tid, 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] => 245
)
 in EntityAPIController->query() (line 187 of entity/includes/entity.controller.inc).
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                                                                                                                                                                                                                                                                                                                     [error]
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.tid' 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.tid AS tid, 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] => 245
)
 in EntityAPIController->query() (line 187 of entity/includes/entity.controller.inc).

Status: Fixed » Closed (fixed)

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