I updated Drupal core to 6.26 along with several other modules. Webform editing somehow got corrupted--the JS drop down editing would not drop down. To solve that problem, I reinstalled Java Script Update and Webform 3.18. This fixed the drop down issue, but introduced another problem. The drop down box now has a red box with the following 2 errors:
warning: Invalid argument supplied for foreach() in /web/virtual/georgewright.org/htdocs/sites/all/modules/webform/includes/webform.components.inc on line 504.
warning: Invalid argument supplied for foreach() in /web/virtual/georgewright.org/htdocs/sites/all/modules/webform/includes/webform.components.inc on line 504.
I read through the bug reports and followed the advice of several to reinstall Drupal Core and the same version of webform once more, but neither worked to fix the error.
I would be grateful for any thoughts or portential solutions for this problem.
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | form_builder_new_element_nid-1607032.patch | 606 bytes | quicksketch |
| #6 | webform-error.png | 37.55 KB | oriol_e9g |
| Webform error 504.jpg | 703.4 KB | smithangj |
Comments
Comment #1
quicksketchIf you're using Form Builder (looks like you are), I suggest upgrading to the latest dev version of both Webform and Form Builder until the next release of each module is released.
Comment #2
quicksketchLet's move this to Form Builder, since that's the more likely culprit.
Comment #3
smithangj commentedI updated to dev versions of both modules and the error still appears. I will keep an eye out for further notes. Thanks a bunch.
Comment #4
quicksketchPerhaps this is related to #1553108: Invalid argument supplied for foreach() in form_builder_webform_form_builder_load() with unknown types? I still haven't been able to reproduce the problem, so if you can try out the new 1.1 version of the module (which includes that fix) and report back, I'd appreciate knowing if the problem has been solved.
Comment #5
oriol_e9gWith:
Webform 6.x-3.18
Form builder 6.x-1.1
Options element 6.x-1.7
jQuery UI 6.x-1.5
I get two errors #1720528: Missing argument 4 for form_builder_property_options_form() and #1598804: Invalid argument supplied for foreach() in _webform_components_tree_flatten()
When I apllied the the patch in http://drupal.org/node/1598804#comment-6035850 and in http://drupal.org/node/1720528#comment-6329504 I get this error now: xxx/drupal/sites/all/modules/webform/includes/webform.components.inc a la línia 504.
I think everything is related :/
Comment #6
oriol_e9gI can reproduce this error in a fresh Drupal 6 installation:
Environment: Drupal 6.26 - Apache/2.2.22 (Win32) PHP/5.3.13
Steps:
1. Install a fresh Drupal 6.26
2. Install and enable:
3. Go to node/add/webform, add a random title and Save

4. Drag&Drop checkboxes field in the Form preview area
5. Click on a default selected checkbox
6. See the error:
Plus: If I update to webform 6.x-3.x-dev I get the same error four lines below:
Comment #7
quicksketchThanks @oriol_e9g. I'll give this a shot. Sounds like we have a high degree of certainty this is a bug.
Comment #8
oriol_e9gI have tested the same with a fresh install of:
Drupal 7.15
Webform 7.x-3.18
Form builder 7.x-1.2
Form builder Webform UI 7.x-1.2
Options element 7.x-1.7
And It's working fine! So, this bug it's specific for the 6.x version.
Comment #9
jonathonfletcher commentedI too am experiencing this issue, to add to this, it is possible to insert new fields and label these etc. however, after saving the webform, these new fields are not visibile in the webform.
Is there any update on a resoltuion to this?
I have even tried installed the Dev version with no noted change to the issue.
Comment #10
asmaabd commentedi found out the solution :)
here is the steps:
1- go to the (....\modules\webform\includes) open the file (webform.components)
2- go to line 504
3- put the following code above it
if (is_array($values))
{
4-now you need to close the if..so, go to line 518 (or whatever the end of the foreach) and type under it
}
the final code should be like this (the one in bold is the new lines)
------------------------------
if (is_array($values))
{
foreach ($node->webform['components'] as $cid => $test_component) {
// Only components before the pagebreak can be considered.
if ($test_component['type'] == 'pagebreak') {
$last_pagebreak_slice = $counter;
}
if (isset($component['cid']) && $cid == $component['cid']) {
break;
}
if (webform_component_feature($test_component['type'], 'conditional')) {
$conditional_components[$cid] = $test_component;
$counter++;
}
}
}
--------------------------------
this forum was helpful for me to figured it out
http://stackoverflow.com/questions/2630013/invalid-argument-supplied-for...
best of luck to you all :)
Asma
Comment #11
quicksketchI finally can reproduce this problem after updating Drupal core to 6.26. Odd that it was working perfectly fine in the previous version. My local was still back on 6.19, but I'm surprised that any core update would cause such a problem.
I'm looking into this now. Thanks everyone for the repeated updates.
Comment #12
quicksketchThis patch corrects the issue by making the $node object available for newly added form components.
Comment #13.0
(not verified) commentedEdited language for clarity.