I am using the Node clone module 6.x-1.0 and the latest 6.x-3.x-dev version of Webform. In the past, Node clone worked fine to clone Webform 6.x-2.9 nodes and also nodes from earlier 6.x-3.x-dev snapshots. However, the webform components from nodes created with the latest 6.x-3.x-dev won't clone anymore. Is there any change we could get that very useful time-saving functionality back? Or should I rather ask in Node clone's issue queue? Thanks.

CommentFileSizeAuthor
#5 webform3_fix_clone.patch1.74 KBquicksketch

Comments

roball’s picture

Hm, after cloning a webform node (which do not clone anything webform specific properties), I see the following 2 PHP error messages in my dblog:

array_filter() [<a href='function.array-filter'>function.array-filter</a>]: The first argument should be an array in /etc/drupal/all/modules/webform/webform.module  on line 790.

and

Invalid argument supplied for foreach() in /etc/drupal/all/modules/webform/webform.module  on line 790.

Line 790 of webform.module is the first line of code of the following snippet:

  // Set the per-role submission access control.
  foreach (array_filter($node->webform['roles']) as $rid) {
    db_query('INSERT INTO {webform_roles} (nid, rid) VALUES (%d, %d)', $node->nid, $rid);
  }

May this be the reason why the webform components no longer clone?

roball’s picture

I have read that Webform 6.x-3.0-beta1 is planned to be released in a view weeks. Great news! quicksketch, do you think, this problem will be fixed then? I am just asking because the ability to clone a webform node is very important to me. Thanks!

quicksketch’s picture

Category: feature » bug

I'll definitely get to this next opportunity I'm working on Webform. Thanks for all the reports roball. :-)

zapscribbles’s picture

Awesome! Will be keeping an eye on this

quicksketch’s picture

StatusFileSize
new1.74 KB

I've committed the attached patch which restores compatibility with Node Clone module.

quicksketch’s picture

Status: Active » Fixed
roball’s picture

Yeah, cloning works fine again :-)
Thanks a lot for the quick fix!

Status: Fixed » Closed (fixed)

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

jglynn’s picture

Version: » 6.x-3.0-beta5
Status: Closed (fixed) » Active

I'm using webform 6.x-3.0-beta5, and I'm using webform enabled on another content type called "event"

When I try to use node clone to copy an event node, I get this error.

user warning: Duplicate entry '71-1' for key 'PRIMARY' query: INSERT INTO webform_component (nid, cid, pid, form_key, name, type, value, extra, mandatory, weight) VALUES (71, 1, 0, 'sample_field', 'sample field', 'textfield', '', 'a:11:{s:8:\"disabled\";i:0;s:6:\"unique\";i:0;s:20:\"conditional_operator\";s:1:\"=\";s:5:\"width\";s:0:\"\";s:9:\"maxlength\";s:0:\"\";s:12:\"field_prefix\";s:0:\"\";s:12:\"field_suffix\";s:0:\"\";s:11:\"description\";s:0:\"\";s:10:\"attributes\";a:0:{}s:21:\"conditional_component\";s:0:\"\";s:18:\"conditional_values\";s:0:\"\";}', 0, 0) in /home/smd/public_html/sites/all/modules/webform/includes/webform.components.inc on line 635.

It says the clone has been created, but I'm not sure the webform will work correctly?

quicksketch’s picture

Status: Active » Closed (fixed)

See #768960: Webform nodes no longer can be cloned for handling of the current issue.

sisko’s picture

Is there a D7 version for webform 7.x.3.18, please?

sk2013’s picture

Is there any alternative solution for D7 or this D6 patch is ported to D7?

Thanks for any help,

Senthil