I recently update from alpha to alpha-2. The update scripts ran fine, and the existing queues were working ok, but I get an error when trying to create a new queue.
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'qid' doesn't have a default value: INSERT INTO {nodequeue_queue}
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'sqid' doesn't have a default value: INSERT INTO {nodequeue_subqueue} (qid, reference, title)
So, it looks like what is happening is that the fields were updated to varchars in the update, but that code is expecting them to get default IDs.
Comments
Comment #1
brenk28 commentedThis patch uses the queue machine name for the IDs. Which looked like what the update script did for my existing queues. (Well, for the qids, for the sqids I got stuff like '4d5c54dd14d30' so I wasn't sure if that was how they should be or not; this patch just uses the name for the qids.)
Comment #2
amateescu commentedUpdate functions from alpha1 to alpha2 are
nodequeue_update_7201()andnodequeue_update_7202()and neither one doesn't touch qids or sqids.Do you have a backup of your database prior to the alpha2 update? Something went wrong in your install but I can't see any problems in those two functions..
Comment #3
amateescu commentedPlease reopen if you can provide more info.
Comment #4
StuddMan commentedHad same issue, applied the patch in #1 and can add nodes again.
Comment #5
tomdavidson commentedI am struggling with the same and I can reproduce it with OpenPublic beta2 on BOA. Amateescu, can you tell me what info you need?
Comment #6
rplescia commentedSame issue for me on 7.x-2.0-beta1
Comment #7
bcobin commentedI also see the same using 7.x-2.0-beta1 on OpenPublic beta5, which has certain defaults as part of the installation profile. (Full error below.)
Has there been any progress on this - should I consider trying out the .dev version and see if that helps? Any guidance greatly appreciated!
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'qid' doesn't have a default value: INSERT INTO {nodequeue_queue} (name, title, subqueue_title, size, link, link_remove, owner, show_in_links, show_in_tab, show_in_ui, i18n, reverse, reference) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array ( [:db_insert_placeholder_0] => debunction_queue [:db_insert_placeholder_1] => Debunction queue [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 10 [:db_insert_placeholder_4] => Add to queue [:db_insert_placeholder_5] => Remove from queue [:db_insert_placeholder_6] => nodequeue [:db_insert_placeholder_7] => 1 [:db_insert_placeholder_8] => 1 [:db_insert_placeholder_9] => 1 [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 ) in nodequeue_save() (line 870 of /home/[site]/public_html/profiles/openpublic/modules/contrib/nodequeue/nodequeue.module).UPDATE: Tried the .dev version - same error. This is happening on both the sandbox and pre-launch site - any ideas? Thanks... standing by...
Comment #8
albert volkman commentedThis is the result of qid becoming a varchar instead of an integer. The column qid should really be renamed machine_name, and qid can no longer be referred to as the default value. I've used this patch and got it working on my install of OpenPublic.
Comment #9
dubois commentedTweaked the patch to follow standard format (plays nice with drush make). Applies to 7.x-2.0-beta1 and solves my issue. FYI: Also previously used OpenPublic for this site but have since moved over to Minimal install profile.
Comment #10
recrit commentedI ran into this error on a site with an existing nodequeue install. It appears that at some point the qid and sqid fields were switched to varchar or not correctly updated to serial for a primary key field, even though the module's schema states serial. I did not have any nodequeues built so a fresh install of the module created the table correctly with qid and sqid being a serial field.
A fix could be created to:
[1] change the qid and sqid fields properly to a serial field per https://api.drupal.org/api/drupal/includes%21database%21database.inc/fun... for primary key changes.
[2] Udpdate all qid, sqid in other tables - nodequeue_types, nodequeue_roles, etc
OR Update to 3.x that uses machine names instead of serial ids
Comment #11
fizk commented