Closed (duplicate)
Project:
Migrate Webform
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2014 at 22:11 UTC
Updated:
17 May 2015 at 02:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dags commentedI "fixed" this issue by adding the following line to the submissions.inc:
$this->addFieldMapping('serial', 'sid');I think we can come up with a better solution though. I looked over the webform code and found that the serial field starts at 1 and increments by 1 as new entires are added to the table. Why the field doesn't auto_increment itself I don't know... but there is a column on the `webform` table called 'next_serial' that holds the serial value for the next submission. So if there is only 1 submission, then 'next_serial' holds 2.
Comment #2
mausolos commentedIt doesn't auto increment because you can only have one auto increment column, and it has to be the primary key.
Another solution is to just allow serial to be NULL (which I did, manually, after my previous solution didn't work on another subsite).
Comment #3
techninja commentedHere's a patch for #1. Tested and works fine for my use cases.
Comment #4
heddnI checked out a couple options here and the proposed option seems the best. Calling _webform_submission_serial_next_value() directly in prepare_row() resulted in duplicate serial ids. Probably a bug in _webform_submission_serial_next_value due to race conditions. Regardless, it seems safe to use sid.
Comment #5
heddnFixed in #2390317: Rows are ignored if external node migration is used