Error on Cloning Webform Module
| Project: | Webform |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
I recently installed node_clone-6.x-1.0-beta2, on Drupal 6.2, set it up under Administer/... , ran update.php, but I get the following error (repeated many times for each field in the webform) when I Submit the clone of a webform (module works fine with node=page):
Warning: 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:290:\"Duplicate entry '26-1' for key 1\nquery: INSERT INTO webform_component (nid, cid, pid, form_key, name, type, value, extra, mandatory, weight, email) VALUES (26, 1, 0, 'basic_info', 'Basic Info', 'fieldset', '', 'a:0:{}', 0, -10, 1)\";s:5:\"%file\";s:90:\"/home/timschen/public_html/ifipartnersorg/sites/all/modules/webform/webform_components.inc\";s:5:\"%line\";i:478;}', 3, '', 'http://ifipartnersorg.timschenz.com/node/26/clone', 'http://ifipartnersorg.timschenz.com/node/26/clone in /home/timschen/public_html/ifipartnersorg/includes/database.mysql.inc on line 128
When I return to the clone page or front page I get (for entries 26-1 through 26-x):
user warning: Duplicate entry '26-1' for key 1 query: INSERT INTO webform_component (nid, cid, pid, form_key, name, type, value, extra, mandatory, weight, email) VALUES (26, 1, 0, 'basic_info', 'Basic Info', 'fieldset', '', 'a:0:{}', 0, -10, 1) in /home/timschen/public_html/ifipartnersorg/sites/all/modules/webform/webform_components.inc on line 478.
The resulting clone does not have the form "fields" cloned, just an empty webform module.
I've repaired the database using phpMyAdmin, but still no success.
Any idea what I'm doing wrong?
Tim Schenz

#1
Well, 5.x webform works ok with Clone, and Clone changed fairly little, so perhaps it's due to a change in the 6.x webform?
#2
What's the next step? Can I try Webform 5.x on Drupal 6.2? Should I report this as an issue with node_clone 6.x? As a bug with Clone? A bug with Webform?
#3
pwolanin already moved the issue into the Webform queue in his reply in #1. I'll see if Webform has any problem with the current version of node_clone. What version of Webform are you using on the site?
#4
Now using webform-6.x-2.1.1
#5
Now using webform-6.x-2.1.1
#6
Looks like a change in version 2.1 broke the compatibility with clone module. This patch should fix the problem (applies to the 2.1.1 version for Drupal 6). Could you give it a try and let me know if it solves the problem for you?
http://drupal.org/patch/apply
#7
#8
I just submitted a bug over at Node Clone, thinking it was an issue there. Is it a Webforms issue, or Node Clone?
http://drupal.org/node/279707
I'm working on the 5.x versions, not on 6.x.
#9
It looks like a bug with Webform, the above patch should work on both Drupal 5 and 6 versions, as the same problem occurs in both places.
#10
Similar problem with Node Export #279511: Import/Export doesn't work with Webform 2.x ... the above patch did not work for me (Webform 5.x-2.1.1 and Node Export 5.x-1.2alpha)
Node Export is based on Node Clone code (but meant for copying from one DB to another)
Node export creates a text file with all of the webform components listed, but trying to import it, it fails to create the components at all.
#11
I applied the patch and I can now clone a webform! Thanks for the patch - it's going to save me a whole lot of work.
Tim
#12
Great! So when will the patch make it into the next release?
#13
The patch works for drupal5 with webform-5.x-2.1.1, and node_clone-5.x-2.5.
Thank you very much.
#14
The patch from #6 has been applied and it's in the 2.1.2 version of Webform.
#15
Thank you QuickSketch for you excellent work as usual. Applied patch to Webforms 5.x-2.0 / node_clone 5.x-2.4 and fixed my issue.
#16
Automatically closed -- issue fixed for two weeks with no activity.