Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
i want to create a webform , when i submit the new webform there is a error:
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'nid' doesn't have a default value: INSERT INTO {webform} (confirmation, confirmation_format, redirect_url, status, block, allow_draft, auto_save, submit_notice, submit_text, submit_limit, submit_interval, total_submit_limit, total_submit_interval, progressbar_bar, progressbar_page_number, progressbar_percent, progressbar_pagebreak_labels, progressbar_include_confirmation, progressbar_label_first, progressbar_label_confirmation, preview, preview_next_button_label, preview_prev_button_label, preview_title, preview_message, preview_message_format, preview_excluded_components) 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, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23, :db_insert_placeholder_24, :db_insert_placeholder_25, :db_insert_placeholder_26); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => <confirmation> [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 1 [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => -1 [:db_insert_placeholder_10] => -1 [:db_insert_placeholder_11] => -1 [:db_insert_placeholder_12] => -1 [:db_insert_placeholder_13] => 1 [:db_insert_placeholder_14] => 0 [:db_insert_placeholder_15] => 0 [:db_insert_placeholder_16] => 1 [:db_insert_placeholder_17] => 1 [:db_insert_placeholder_18] => Start [:db_insert_placeholder_19] => Complete [:db_insert_placeholder_20] => 0 [:db_insert_placeholder_21] => [:db_insert_placeholder_22] => [:db_insert_placeholder_23] => [:db_insert_placeholder_24] => [:db_insert_placeholder_25] => [:db_insert_placeholder_26] => ) in drupal_write_record() (line 7166 of /drupal7/includes/common.inc).
Comment | File | Size | Author |
---|---|---|---|
#4 | webform-insert_nid-2119193-4.patch | 711 bytes | grahamC |
Comments
Comment #1
谢艳 CreditAttribution: 谢艳 commentedI do not know exactly what's wrong, but I have solved this problem。
I guess the data structure in question, the installation is not fully installed, so i uninstall the module, clear the cache, reinstall ……problem solved
Comment #2
jaroslaw.kaminski CreditAttribution: jaroslaw.kaminski commentedHello.
I did what you said and it's not solved my problem :( I have same error on 7.x-4.0-beta1+4-dev
Comment #3
grahamCI'm seeing this too in 7.x-4.x HEAD. I've traced it to the code in
webform_node_insert()
:So the
$webform_record
doesn't have annid
set when the record is being created.Comment #4
grahamCBarely worth making a patch for, but here it is anyway.
Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedseems this was broken in http://drupalcode.org/project/webform.git/commit/d0a1fc5
Comment #6
MXTPatch provided in #4 works very well for me.
This is very CRITICAL: can this be committed ASAP?
Thank you very much
Comment #7
hswong3i CreditAttribution: hswong3i commentedConfirm that patch from #4 works well, and I had now applied it to my drustack_webform.make ;-)
Thank you very much~~~
Comment #8
tripper54 CreditAttribution: tripper54 commented+1 for #4 for me. Thanks!
Comment #9
kscheirerPatch in #4 worked for me. Definitely critical, as the 4.x-dev branch is useless w/o being able to create new webforms.
Comment #10
rwilson0429 CreditAttribution: rwilson0429 commentedAgree, without the patch in #4, the 7.4.x-dev is useless in creating new webforms. Applying the #4 patch fixed it for me too. However, to get it to work I had to completely disable the webform module and uninstall it. After uninstall, ran update.php and flushed the caches. Downloaded the 7.x-4.x branch, applied the patch before enabling the module. It seems to work.
Comment #11
TwoDYep, #4 works great, and Webform is useless without it.
Comment #12
quicksketchThanks guys, committed and this should be in the release tomorrow.
Comment #14
fenstratNeeds to be ported to 8.x-4.x.
Comment #15
fenstratCommitted 64eb545 to 8.x-4.x.