Hello,

I successfully cloned a simple Webform (textfields only) with a fresh D7 install and Webform 7.x-3.6. Unfortunately, while trying to clone a more complex Webform (texfields, select lists, radio buttons, fieldsets...) I came across this error :

PDOException : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY': INSERT INTO {webform_validation_rule} (ruleid, rulename, nid, validator, data, error_message) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => Numeric values only [:db_insert_placeholder_2] => 8 [:db_insert_placeholder_3] => numeric [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => ) in drupal_write_record() (lin 6776 in /www/drupal/includes/common.inc).

Thank you for your help

Comments

jonaswouters’s picture

subscribing

pwolanin’s picture

Project: Node clone » Webform
Version: 7.x-1.0-beta1 » 7.x-3.x-dev

Webform has in the past cleaned up up its data so that cloning was possible. Look like the cloning may not be really possible in D7 if you need the final nid at the time the clone is made.

quicksketch’s picture

Project: Webform » Webform Validation
Version: 7.x-3.x-dev » 7.x-1.0-rc1

Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY': INSERT INTO {webform_validation_rule}

I'm betting this is not an issue with Webform, but the Webform Validation module. Webform should already make sure that components don't run into this integrity constraint when inserting into its own tables.

anavarre’s picture

@quicksketch

You are absolutely right. As soon as I deactivate the Webform Validation module, the node is cloned successfully.

cschenker’s picture

@qucksketch
Thank's for that advice - it worked for me too! Saved me heaps of time though! :)

svendecabooter’s picture

Assigned: Unassigned » svendecabooter
svendecabooter’s picture

Assigned: svendecabooter » Unassigned
Status: Active » Fixed

The PDOException error has been fixed now.

Status: Fixed » Closed (fixed)

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