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

CommentFileSizeAuthor
#6 webform_clone_nid.patch1.38 KBquicksketch

Comments

pwolanin’s picture

Project: Node clone » Webform
Version: 6.x-1.0-beta2 » 6.x-2.x-dev

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?

tschenz’s picture

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?

quicksketch’s picture

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?

tschenz’s picture

Now using webform-6.x-2.1.1

tschenz’s picture

Now using webform-6.x-2.1.1

quicksketch’s picture

StatusFileSize
new1.38 KB

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

quicksketch’s picture

Status: Active » Needs review
mgenovese’s picture

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.

quicksketch’s picture

Category: support » bug

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.

sethcohn’s picture

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.

tschenz’s picture

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

mgenovese’s picture

Great! So when will the patch make it into the next release?

solanas’s picture

The patch works for drupal5 with webform-5.x-2.1.1, and node_clone-5.x-2.5.

Thank you very much.

quicksketch’s picture

Status: Needs review » Fixed

The patch from #6 has been applied and it's in the 2.1.2 version of Webform.

UnicornSong’s picture

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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

zapscribbles’s picture

Version: 6.x-2.x-dev »
Status: Closed (fixed) » Active

Sorry to reopen this, but I am having a similar problem with the 3.x dev version of Webform. When i try and clone, after entering the Title field and clicking submit I get these errors on the webform components tab:

* warning: array_filter() [function.array-filter]: The first argument should be an array in D:\wamp\www\sites\all\modules\webform\webform.module on line 790.
* warning: Invalid argument supplied for foreach() in D:\wamp\www\sites\all\modules\webform\webform.module on line 790.

The code above and below line 790 is exactly the same as the code in the patch in #6. I also checked 2.9, and it looks like this patch has been committed there (though it is on line 400-something). Is there something else I need to do to get this working? Is it happening due to other code included in the dev version that isn't in 2.9?

I am only using Dev for its Views integration, and up until now have had no issues with it

quicksketch’s picture

Version: » 6.x-2.x-dev
Status: Active » Closed (fixed)

The bug for the 3.x version is reported separately in #700446: Clone of webform components.