After installation of the webform module I wanted create a little testform, but after saving the form I got the following warning:
"Invalid argument supplied for foreach() in .../sites/all/modules/webform/webform_components.inc on line 31"
If I want to add fields to this form i get the following warnings:
"Invalid argument supplied for foreach() in .../sites/all/modules/webform/webform_components.inc on line 244"
and
"Invalid argument supplied for foreach() in .../sites/all/modules/webform/webform_components.inc on line 31"
There ist the same behavior after deleting this version and installation of the new version "6.x-3.x-dev".
I apologize if this is already reported or addressed elsewhere. But I didn't find a solution yet.
Thanks
Comments
Comment #1
quicksketchYou cannot run the 3.x version and then downgrade to 2.x. You've probably permanently damaged your database. You'll need to delete all the webform tables from your database and all the entries from the variables table that begin with webform_.
Comment #2
iceman2202 CreditAttribution: iceman2202 commentedThanks for the hint. But I think, the problem was already there before the downgrade to 6.x-2.9.
After uninstalling webform, then deleting all webform-Tables and variables and new installation of webform 6.x-2.9 the problem exists furthermore.
Perhaps, you can give me another hint?
Comment #3
quicksketchHmm, the line in question here is:
foreach ($node->webform['components'] as $cid => $component) {
My guess is that this node is of type "webform", but since Webform was uninstalled all of its components are missing yet the node was not deleted (Webform does not delete nodes even if it's uninstalled). Try deleting all the previous nodes of type "webform" and creating a new one.
I know for sure that the error you're describing does not exist on a clean install, considering the thousands of other active installations running the 2.9 version.
Comment #4
iceman2202 CreditAttribution: iceman2202 commentedI had some webform installations in test environments before without problems. One of these environments ist still alive und is running with webform without errors!
Now I made the following attempts after your replies:
There isn't any change. The same errors as before!
This drupal installation should soon become productive and webform is one of the important components. Is there a possibility to reach a "clean" webform environment without complete installation of drupal and the modules?
Comment #5
bdhoundus CreditAttribution: bdhoundus commentedI am having the same problem as iceman. I accidentally upgraded from 2.9 to 3.x-dev... and the web form used on the site was broken. I tried reverting back to 2.9 and got the same error messages as iceman. I deleted the webform node, deactivated the webform module, uninstalled the webform module, removed the webform_ entries in the variables table and verified that all of the webform_ tables were gone. Installed 2.9, activated it, ran update.php (now no errors when running update.php), made sure permissions were correct for the webform module.
Created a new webform node (no problem). Went to add a form component and got the same following errors:
"Invalid argument supplied for foreach() in .../sites/all/modules/webform/webform_components.inc on line 244"
and
"Invalid argument supplied for foreach() in .../sites/all/modules/webform/webform_components.inc on line 31"
After attempting to enter components, if I look at the webform_component table, I see the added components in the table. They just won't appear when trying to edit the node (and don't show when viewing the node either). Where do the form components get married to the node in the database?
Comment #6
bdhoundus CreditAttribution: bdhoundus commentedWell, I repeated the uninstall of the webform module today. In addition to the steps mentioned before, I also went into phpMyadmin and did a search in all tables for "webform".
It will be found in a bunch of tables. The only tables that I went in and deleted the "webform" entries from were the following:
menu_links (3 records found)
menu_router (4 records found)
node_type (1 record found)
After that, I also selected all the tables and did an "optimize" just to clean things up. Then, I reinstalled Webform 2.9 and everything was working fine.
Comment #7
Rick Nashleanas CreditAttribution: Rick Nashleanas commentedSubscribing.
Comment #8
iceman2202 CreditAttribution: iceman2202 commentedThank you bdhoundus,
I deleted all the the webform entries in the same tables (menu_links, menu_router, node_type ).
Now it works fine.
Comment #9
roball CreditAttribution: roball commentedSame problem observed here - seems that the 3.x-dev uninstaller needs work. Fixed by manually deleting the tables as mentioned in #6.
Comment #10
roball CreditAttribution: roball commented[OT] BTW, bdhoundus (#5), what was broken after you upgraded from 2.9 to 3.x-dev? I did not get something broken after the upgrade.
Comment #11
mathieu_ch CreditAttribution: mathieu_ch commentedHad the same problem with a downgrade Webform from 3.x to 2.9.
Here's my recipe, works for sure: I don't run in "cant display component" errors anymore.
Comment #13
troynt CreditAttribution: troynt commentedStill seeing this issue after following advice of #11 & #6
What is causing this?
Comment #14
troynt CreditAttribution: troynt commented^forgot to reopen
Comment #15
quicksketchLet's not have this issue open multiple times. See #721662: Downgrading Webform causes "warning: Invalid argument ..." in Form components.
Comment #16
Marat CreditAttribution: Marat commentedThis is the thing that I missed and made a lot of trouble! Thanks
Comment #17
ggevalt CreditAttribution: ggevalt commentedI must say that after struggling with this for several hours today, it's nice to find this, but it's also too bad to see some really incomplete information about this module. We had not used this module in a while and really had not been aware that we'd updated the module like good doobies but as soon as we activated it it blew apart our whole site. Three hours later, we were able to get everything back to normal and now have nonworking Webforms and have to go through all these hoops to somehow fix all the references to webform and then try all over again.
Please do not misunderstand. I so appreciate the work that is done with drupal by all you folks. but man it is hard to see this kind of damage from a module that clearly has flaws and should not have been put out there. I realize the module says that you can't revert back, but there was absolutely no hint as to the kinds of trouble that could occur by upgrading to the 6.3 version. And frankly, the prospect of now further repairing my "damaged" database is daunting. And incredibly frustrating.
The problems with upgrading this module to 6.3 really should be outlined more clearly. I can tell you this, it turned my entire site into WSOD. And I've been picking up the pieces ever since.
And I don't mean this to sound harsh. Really.