I updated successfully from 7x4-alpha6 to 7x4.2 and ran database updates which were successful as well. I went to add a new form component text field and I get this error below?
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'required' in 'field list': INSERT INTO {webform_component} (nid, cid, pid, form_key, name, type, value, extra, required, weight) 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); Array ( [:db_insert_placeholder_0] => 543 [:db_insert_placeholder_1] => 51 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => test_ [:db_insert_placeholder_4] => test [:db_insert_placeholder_5] => textfield [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => a:4:{s:13:"title_display";s:6:"before";s:7:"private";i:0;s:15:"wrapper_classes";s:0:"";s:11:"css_classes";s:0:"";} [:db_insert_placeholder_8] => 0 [:db_insert_placeholder_9] => 38 ) in webform_component_insert() (line 782 of /var/www/hosts/kmdsi-d/sites/all/modules/webform/includes/webform.components.inc).
After researching webform issues I have found multiple solution to change column name from "mandatory" to "required" like this one here: https://www.drupal.org/node/2316743
Solutions I have tried:
1) change column name from "mandatory" to "required", then update database
2) update 7x4.2 to 7x4.2-dev and update database
3) uninstalled webform module and then re-installed module and update dbase
Please let me know if anyone has solutions...Thanks for you time felllow drupalers!
Comment | File | Size | Author |
---|---|---|---|
Screen Shot 2015-01-15 at 10.48.040 AM.png | 79.04 KB | Ndesign |
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedSomewhere along the line, update didn't run or didn't run successfully. You need to restore the version of webform whose update routine last worked, then disable the module, then
disableuninstall the module, then download the latest version, then re-enable the module. In this way, your tables will be re-created.If this isn't possible, then you will have to examine the database and look at the update routines in webform.install to see what changes need to be made by hand. This may or may not be practical, depending upon what you find.
Comment #2
Ndesign CreditAttribution: Ndesign commentedSounds good Dan I will give it a shot and see what I find upon updates...Thank you!
Comment #3
Ndesign CreditAttribution: Ndesign commentedThings worked just fine with disabling old version and enabling 7x4.2 with no database updates : ) ..thank you so much....Is there an easy way to import webform content types and/or submissions?
Comment #4
DanChadwick CreditAttribution: DanChadwick commentedNo. When you uninstalled, all the webforms and submissions were deleted. To re-import them, you could use something like migrate, but I'm pretty sure there would be a ton of custom code involved. Bummer.
Comment #5
Ndesign CreditAttribution: Ndesign commentedOkay thanks again for your help.
Comment #7
VVS CreditAttribution: VVS commentedIm manually run:
ALTER TABLE `webform_component` CHANGE `mandatory` `required` TINYINT(4) NOT NULL DEFAULT '0' COMMENT 'Boolean flag for if this component is required.';
Comment #8
aubjr_drupal CreditAttribution: aubjr_drupal commentedIf by chance you run into an error like:
PDOException: SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value: ALTER TABLE {webform_component} CHANGE `mandatory` `required` TINYINT NOT NULL DEFAULT 0 COMMENT 'Boolean flag for if this component is required.'; Array ( ) in db_change_field() ....
There are probably some rows in the webform_component table that have mandatory set to NULL. If you verify this is the case, clear out the NULLs with something like:
UPDATE webform_component SET mandatory=0 WHERE mandatory IS NULL;
At that point, the webform update #7408 will apply cleanly.