Upgraded to Drupal 4.7.3 last week. Was on 4.6.x. Had a webform that was working fine prior to the upgrade. Afterwards, the records pre-update are gone and none of the analytical or table stuff works even on webform submissions following the upgrade. For example:

Had a form that had been submitted 9 times. None of the 5 pre-4.7 records is shown on the web page under submissions.

The 4 post-4.7 records are listed under the submissions tab but the viewing, analysis, table and download show no data. All blank fields. They're listed in the webform_submissions table. Here is the data from the download:
Survey: Page rates on reporter's record.,,,"","",""
Submission Details,,,"choices","",""
Serial,Time,SID,"Under $3,$3 to 3.99,$4 to 4.99,$5 to 5.99,$6 and over","jurisdiction","comments"
1,"12/31/1969 - 7:00pm",,"No,No,No,No,No","",""
2,"12/31/1969 - 7:00pm",,"No,No,No,No,No","",""
3,"12/31/1969 - 7:00pm",,"No,No,No,No,No","",""
4,"12/31/1969 - 7:00pm",,"No,No,No,No,No","",""

However, the DATA for the FIRST 5 (pre-4.7) submissions is actually IN the database in webform_submitted_data. There is NO data for the LAST 4 (post-4.7) submissions in webform_submitted_data.

I have followed the instructions in the install.txt file to kill the tables in the database and reloaded, and I have emails with the data available that way but if someone has a lot of data and was depending on the tables, they may be out of luck.

Next I will test after reloading the tables and see if the problem is replicated. Look for my reply to myself.

gil

Comments

Capnj’s picture

Better but still broken. After reloading all the tables and entering one record, the first time I went to Results, the one record was listed. The analysis was correct. Table was blank. The download has no data, only fields.
In the database:
webform = 0 records
webform_component = the form, looks ok.
webform_role_node = 0 records
webform_submissions = 0 records
webform_submitted_data = 6 records reflecting the one submission. Looks ok.

Oh, and the confirmation message is not displayed.

So, thinking I was nuts, I entered another record. I mean, how can the submission tab show one submission, and then not?
Same result, except nothing listed as a submission. Musta mis-looked. Analysis is still good but the submission record is gone.

gil

Capnj’s picture

Here is the log entry corresponding:
Unknown column 'user' in 'field list' query: INSERT INTO webform_submissions (nid, sid, submitted, user, remote_addr) VALUES (75, 6, 1155420226, 'gil.jones', '64.139.251.248') in /home/dcourt2/public_html/forum/includes/database.mysql.inc on line 120.

ullgren’s picture

Did you run the http://www.yourdrupalsite/update.php script after updating the module ?

Capnj’s picture

Yes. Update was run, but in fact the database was not updated correctly. I even went back and ran update again and it showed no updates available for that module. I've now manually fixed the db and things are working now with the forms.

gil

quicksketch’s picture

Sorry about the trouble. Did you make a backup of your DB before upgrading? I'd like to have a look at what went wrong. If possible could you sent me a copy of: 1. SQL Dump of the 4.6 webform tables 2. A copy of the webform directory you used in 4.6. If you zip the files and post them to this thread or email them to me (nate@quicksketch.org) I'll try to find what went awry.

uccio’s picture

Hi

I have same problem, my old submission are lost!!
I had update 4.6.6 to 4.7.3 this morning.

Thanks

Capnj’s picture

By direct email I have submitted to quicksketch the data he needed to investigate the data loss on my upgrade.

gil

quicksketch’s picture

capnj: I didn't seem to receive the email. It probably was spam filtered out and I cleaned up my Junk folder on the 20th. Could you send it again. If you mention 'Drupal' somewhere in the email it'll probably get through without getting filtered.

peter chen’s picture

Hi,

I think I have a similar problem too - I've not used the module much so am not sure when the problem emerged: but upgrading to the latest version hasn't helped. My error on submission is:

user warning: Unknown column 'cid' in 'field list' query: INSERT INTO webform_submitted_data (nid, sid, cid, no, data) VALUES (529, 4, 1156759547, 0, '1\r\n2\r\n3') in /home/shared/peterchen/public_html/peterjohnchen.com/includes/database.mysql.inc on line 120.

and the form (in edit) doesn't seem to "hold" the mailto: address. You can check out the error here (http://www.peterjohnchen.com/diplomacy_turn_submission_form_0) if it helps - I'm not so savvy to pull apart the db.

P

pcwick’s picture

I just upgraded webform from 4.6 to 4.73. I ran the update script. The database appears to be intact, and newly submitted webforms appear to be added to the database appropriately.

While viewing the "reports" page I received an array-merge error on line 89 of webform_reports.inc. The follwing change to line 89 seems to have repaired the error (sorry, don't know how to make a patch yet):

- $header = array_merge($header,$componentHeaders);
+ $header = array_merge((array)$header,(array)$componentHeaders);

I'm not getting the "unknown column" error, however, I am having the previously reported problem with data not appearing under the "submissions" tab or the "table" tab on the reports page. The analysis tab appears to be working properly. Newly submitted webforms (since the upgrade) DO appear under the submissions and table tabs.

dmuth’s picture

I too had a similar issue when I upgraded from Drupal 4.6 to 4.7, and ran the update script. It looks like the data is still intact in webform_submitted_data, but nothing is copied over to webform_submissions. New form submissoins to properly get written to webform_submissions, though.

-- Doug

dmuth’s picture

I did a little more digging around, and it looks like _webform_legacy_module() has a call to _webform_convert_old_submissions(), which is commented out. Also, I cannot find _webform_convert_old_submissions() anywhere in the code.

I'm not sure if that was a project that was started at some point or not, but just thought I'd mention that finding.

-- Doug

sl27257’s picture

Is there a solution for this yet? I mean the upgrade from the 4.6 branch to the 4.7 branch?

/Thomas

sl27257’s picture

I added the following code to webform.install as the ninth update function. By doing so I managed to get all the old data back out of the module. The submission time will be the time when the script was run. The original submission time is forever lost (not recorded during 4.6.x). I have only tested it with MySQL.

/Thomas

function webform_update_9() {
  $ret = array();

  $prev_sid = 0;

  $result = db_query("SELECT nid, sid FROM {webform_submitted_data} ".
                     " WHERE 1 ORDER BY sid");

  while ($row = db_fetch_object($result)) {
    if ($prev_sid <> $row->sid) {
      db_query("INSERT INTO {webform_submissions} (nid, sid, submitted)
                VALUES (%d, %d, UNIX_TIMESTAMP())", $row->nid, $row->sid);
      $prev_sid = $row->sid;
    }
  }


  return $ret;
}
egfrith’s picture

Thanks for this. The above worked for me, but I had "Invalid argument supplied for foreach()" errors when viewing the results of forms where select options had not been filled in. The problem seems to be that there is no data at all in the webform_submitted_data table for the sid,cid combination of the empty select statements. To fix this I ran the following database queries:

    INSERT IGNORE INTO webform_submitted_data (nid,sid,cid) SELECT t1.nid,t1.sid,t2.cid FROM webform_submitted_data AS t1, webform_component AS t2 WHERE (t2.type='select') GROUP BY t1.sid,t2.cid ;
    UPDATE webform_submitted_data SET data='' WHERE data <=> NULL;

This adds rows for the missing cid and sid combintations to webform_submitted_data and fills the data field with the empty string. It seems to work, but be warned: I'm an SQL newbie!

quicksketch’s picture

Status: Active » Closed (won't fix)

Unfortunately if you missed the update to 4.7... I think you're on your own now. I cut support for 4.7 months ago and I'm not going to install 4.6 and try an upgrade. Patches are still accepted though :)