Not sure what is going on here, but maybe it is a bug with PHP. In your webform_node_update function, I noticed that you are doing the following...
$original_cids = array_keys($original->webform['components']);
$current_cids = array_keys($node->webform['components']);
$all_cids = $original_cids + $current_cids;
Given the following arrays, this does not give you what I would expect from PHP....
Adding two arrays array(1,2,3) and array(2,3,4) surprisingly gives the following...
ubuntu@ip-172-19-125-130:~/main/www$ php -a
Interactive shell
php > print_r(array(1,2,3) + array(2,3,4));
Array
(
[0] => 1
[1] => 2
[2] => 3
)
php >
However, if you use array_merge it works as expected....
ubuntu@ip-172-19-125-130:~/main/www$ php -a
Interactive shell
php > print_r(array_merge(array(1,2,3),array(2,3,4)));
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 2
[4] => 3
[5] => 4
)
php >
Patch to follow....
Comments
Comment #1
travist commentedHere is the patch.
Comment #2
travist commentedFound some other offenders.
Comment #3
travist commentedComment #4
travist commentedComment #5
travist commentedProbably should array_unique the merge...
Comment #6
quicksketchThis makes sense to me. The use of array_unique() seems a bit odd, though I realize this is because the array is numerically indexed, so doing a array_merge result in the same value being used twice with two different numeric keys.
Committed to both 3.x branches.
Comment #7
shawn dearmond commented@quicksketch: I don't see these committed to 6.x or master. Maybe they were not pushed? The last commit was six hours before you posted comment #6.
Comment #8
shawn dearmond commentedTested it on D7, though, and it definitely works!
Comment #9
quicksketchIt's there now, sorry I don't push after every commit and it gets me in trouble some times.