Hi there. I have an issue with webforms not saving redirect url. I decided to update after cruising the forums. Updated from 5.x-2.0 to 5.x-2.1.1, ran update.php and WHAM form components gone!
I restored the old version of webforms and restored the old webform tables into my database.
In order to supply as much info as possible (as requested in http://drupal.org/node/276979) i repeat the process.
unzipped webforms5.x-2.1.1 to sites/all/modules
run update.php - webform update 5201. This time no errors were displayed (im sure there was one the first time i updated)
AND my components are still there this time
Also, the first time i updated whenever i tried to edit the form i was given messages about the form being submitted. These errors did not occur this time.
Another wierd thing, I was able to save the redirect url in the first update (where the components dissappeared) but now, with the non-errored update, I cannot save the redirect url. Stranger and stranger. I'll lodge that as its own issue...
So, sorry, I was hoping to supply more info and could not. Also I guess this issue of mine is closed. *sigh*
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | webform_5x1x_6x2x.patch | 2.14 KB | quicksketch |
Comments
Comment #1
UnicornSong commentedfurther to this topic, i moved to my local copy to try to get this all working, had to run updates webform 5.x-2.0 (with email functionality added)
The same thing happened! components disappeared. here is the sql error i received for this one:
Which sounded a lot like the one i got on the live server with the latest update for 5.x-2.1.1. It is important at this point to note that i had added the email functionality to my local webforms as per the issue here http://drupal.org/node/233627 which i believe you have rolled into 5.x-2.1.1?
Hope this all helps pin the problem down?
Comment #2
quicksketchWhoa, hang on here! That update you're reporting that does the "ALTER TABLE webform_submitted_data CHANGE cid cid smallint unsigned NOT NULL default '0'" is webform_update_13. Which should have been ran when you updated from Webform 1.9 (or 1.10) to 2.0. There's no reason why that update should be ran between 2.0 and 2.1.1. Now I'm really confused.
So. It sounds like all your components were wiped when webform_update_13 was ran twice, which sounds possible. When the update was ran on your site and it properly started at update 5201, everything ran fine. This indeed is very strange. Please let me know if any more information becomes available.
Comment #3
UnicornSong commentedNo, we need to start again. I will run through the process again without the patched version. Our live site has lost all its components now (oops left the updated module on the server and this caused errors for our live site, so the boss updated the Db - argh), and that was not using the patch.
Worthwhile to note that when the components dissappear I get watchdog errors like this one:
Anyway, like I say, Im still working on this problem, and will start again and update....
sorry :)
Comment #4
UnicornSong commentedOMG. well I've spent 4 hours trying to track this. Funnily today I cant get any of my local sites to have this error.
Strangely my other issue seems to be overcome today also, must have had something to do with all the restores I did yesterday. today update.php told me i had updates 1-20 and 5200 to run on 5.x-2.0 so i ran them, received errors but now the webform is saving my redirect url. Sweet.
I suspect you may be right, where this issue may be caused by other updates running at the same time?
Closing this issue and running away fast... (still using 5.x-2.0 though!)
Comment #5
quicksketchHa, okay. Please open a new issue if this occurs though. I don't want the guilt of wiping people's databases on my conscious. :)
Comment #6
shusheer commentedHi Guys,
I'm doing a Drupal 5.7 / Webform 5.x-1.10 upgrade to Drupal 6.4 / Webform 6.x-2.1.3, and am experiencing what appears to be exactly this problem (lost components). I've been battling with it for a few hours, but as I am quite new to Drupal, I'm hoping one of you has found the solution to this in the last couple of months.
The relevant line from the system table in each is (note that table structure changed between versions):
Drupal 5:
INSERT INTO `system` (`filename`, `name`, `type`, `description`, `status`, `throttle`, `bootstrap`, `schema_version`, `weight`) VALUES
('sites/all/modules/webform/webform.module', 'webform', 'module', 'Enables the creation of forms and questionnaires.', 1, 0, 0, 12, 0);
Drupal 6:
INSERT INTO `system` (`filename`, `name`, `type`, `status`, `throttle`, `bootstrap`, `schema_version`, `weight`, `info`, `owner`) VALUES
('sites/all/modules/webform/webform.module', 'webform', 'module', 1, 0, 0, 6204, -1, 'a:9:{s:4:"name";s:7:"Webform";s:11:"description";s:49:"Enables the creation of forms and questionnaires.";s:4:"core";s:3:"6.x";s:7:"version";s:9:"6.x-2.1.3";s:7:"project";s:7:"webform";s:9:"datestamp";s:10:"1218174017";s:12:"dependencies";a:0:{}s:10:"dependents";a:0:{}s:3:"php";s:5:"4.3.5";}', '');
When running update.php I also get the update #13 discussed above, but I _AM_ upgrading from 5.10 all the way, so this makes sense:
Update #13
# UPDATE {system} SET weight = -1 WHERE type = 'module' and name = 'webform'
# DELETE FROM {webform} WHERE nid NOT IN (SELECT nid FROM {node} WHERE type = 'webform')
# DELETE FROM {webform_component} WHERE nid NOT IN (SELECT nid FROM {node} WHERE type = 'webform')
# DELETE FROM {webform_submissions} WHERE nid NOT IN (SELECT nid FROM {node} WHERE type = 'webform')
# DELETE FROM {webform_submitted_data} WHERE nid NOT IN (SELECT nid FROM {node} WHERE type = 'webform')
# UPDATE {webform_component} SET cid = 1 WHERE nid = 495 AND cid = 1204928757
# UPDATE {webform_component} SET pid = 1 WHERE nid = 495 AND pid = 1204928757
# UPDATE {webform_submitted_data} SET cid = 1 WHERE nid = 495 AND cid = 1204928757
... lots of similar lines to the above 3 cut out ...
# ALTER TABLE {webform_component} CHANGE cid cid smallint unsigned NOT NULL default '0'
# ALTER TABLE {webform_component} CHANGE pid pid smallint unsigned NOT NULL default '0'
# ALTER TABLE {webform_submitted_data} CHANGE cid cid smallint unsigned NOT NULL default '0'
Although I can see the results of forms, when I now go to view a webform as a user I get the following displayed:
"Submissions for this form are closed."
From a quick search I see that this is probably because no permissions have been given. So I edit the form, and add permissions for both anon and auth users. Then on clicking save I get a very similar error to the next one described above (actually, depending on which form I edit, I get several similar ones at a time):
Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:619:\"Unknown column 'email' in 'field list'\nquery: INSERT INTO webform_component (nid, cid, pid, form_key, name, type, value, extra, mandatory, weight, email) VALUES (776, 2, 0, 'what_do_you_think_of_the_new_site_in_general', 'What do you think of the new site in general', 'select', '', 'a:4:{s:5:\\"items\\";s:59:\\"I love it!\\r\\nI like it\\r\\nIt\\'s OK\\r\\nI don\\'t like it\\r\\nI hate it!\\";s:11:\\"description\\";s:0:\\"\\";s:6:\\"a in /thesite/public/includes/database.mysql.inc on line 128
Any suggestions most appreciated (and my apologies for re-opening the issue - but this seemed the most comprehensive threat to open it under).
Comment #7
zipho commentedHas anybody found a solution or a patch for this issue yet?
Thanks;
Comment #8
UnicornSong commentedWell it might help to re-open the issue so Quicksketch can see it. Doing so now. I was unable to replicate the issue myself, hopefully you two can give him more info....
Comment #9
quicksketchThanks zipho for the reports (and UnicornSong for reopening the issue). It looks like the update is failing in 2 places: setting permissions (webform_update_6202) and adding the "email" column to the webform_components table (webform_update_6201). Did you see these two updates run when you did the upgrade?
You might try updating in the following order:
- Webform 5.x-1.10
- Webform 5.x-2.1.3
- Webform 6.x-2.1.3
I think what's happening here is that many of the 62xx updates are being skipped, since Webform has protections in place to prevent the same update from being run twice when upgrading from Drupal 5 2.x to Drupal 6 2.x. However it looks like they're a little aggressive in skipping updates, and they don't get run at all when moving direct from a 1.x version in Drupal 5 to the 2.x version in Drupal 6.
I think this patch will fix the problem (you'll need to run the upgrade again after restoring a database backup). Please let me know if it works for you.
Comment #10
quicksketchComment #11
quicksketchAfter a few hours of testing, I've found this patch definitely does *not* work. :/
I thought it had been possible to selectively run update functions depending on the user's previous version of Webform, but in actually, this seems to be impossible in Drupal 6 (or at least very difficult and untypical). I think the very best you can do is be sure to upgrade your Drupal 5 site to the latest Drupal 5 2.x version first, then run the update to Drupal 6.
On the Webform end, I can provide an informational hook to Drupal's updater telling the user that they need to update to a newer version of Webform before upgrading to Drupal 6, preventing the updates from being run at all.
Comment #12
quicksketchOkay, I took a completely different approach that seems to work much better. Rather than trying to check the existing schema versions, this change makes it so that Webform simply checks directly if an update has already been run by looking for the existence of columns or tables. I tested all of the following upgrades and seems to work perfect:
- Webform 1.10 (D5) to 2.1.3 (D6)
- Webform 2.0 (D5) to 2.1.3 (D6)
- Webform 2.1.3 (D5) to 2.1.3 (D6)
I'll get out a 2.2 version of Webform that includes these changes so hopefully we can save other users the same trouble.
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #14
wwwna commentedIs there any way to use webforms on an updated drupal 6?
I don't care if my oldest forms are erased I just think is not a good idea to update my whole site to version 7 just to get this module work.