Index: webform/includes/webform.components.inc =================================================================== --- webform/includes/webform.components.inc (revision 18) +++ webform/includes/webform.components.inc (working copy) @@ -732,7 +732,7 @@ $component['mandatory'] = isset($component['mandatory']) ? $component['mandatory'] : 0; $component['extra']['private'] = isset($component['extra']['private']) ? $component['extra']['private'] : 0; - if (!isset($component['cid'])) { + if (empty($component['cid'])) { if (lock_acquire('webform_component_insert_' . $component['nid'], 5)) { $next_id_query = db_select('webform_component')->condition('nid', $component['nid']); $next_id_query->addExpression('MAX(cid) + 1', 'cid'); @@ -764,7 +764,7 @@ ->execute(); // Post-insert actions. - module_invoke_all('webform_component_insert', $component); + //module_invoke_all('webform_component_insert', $component); return $component['cid']; } @@ -855,8 +855,9 @@ */ function webform_component_clone(&$node, &$component) { $original_cid = $component['cid']; - unset($component['cid']); + $component['cid'] = NULL; $new_cid = webform_component_insert($component); + $component['cid'] = $new_cid; if (webform_component_feature($component['type'], 'group')) { foreach ($node->webform['components'] as $cid => $child_component) { if ($child_component['pid'] == $original_cid) { @@ -865,6 +866,8 @@ } } } + //var_dump($component); + //break; return $new_cid; }