Invalid argument supplied for foreach() when previewing a Conference

drupalista - October 29, 2007 - 00:01
Project:Conference Organizing
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Bèrto ëd Sèra
Status:closed
Description

On preview of conference creation form I get:
warning: Invalid argument supplied for foreach() in
/path/to/conference_organizing/conference_organizing.module on line 891.

$form['submitted'] seems to be empty??? hmm, of course i put some values into the form... sorry, to tired now to look deeper into it... goto_sleep($now);

#1

jheretic - January 11, 2008 - 21:21

I am experiencing the exact same problem, otherwise installation works smoothly. Using Freebsd 6.2-STABLE with lighttpd-1.4.18, mysql-5.1.22 and php-5.2.5. Error exists on multiple clean reinstallations, using both Drupal 5.5 and 5.6, with both stable and cvs checkouts (as of 1/10/08) of conference_organizing and webform modules. Get the error on preview, get WSOD on submission. Other site functionality seems to work fine. Anyone have any luck with this one?

#2

Roger Saner - January 14, 2008 - 23:41
Priority:normal» critical

I have the same thing - directly after multiple clean installs (Drupal 5.6 and conference_organizing 5.x-1.x-dev) I put some data into the /node/add/webform/ page and hit "preview". Aside from the preview page looking like no data actually gets carried through, I get:

warning: Invalid argument supplied for foreach() in /path/to/profiles/cod/modules/conference_organizing/conference_organizing.module on line 891.

Something weird is happening with

<?php
foreach ($form['submitted'] as $key => $values)
?>
on line 891. Doing a debug_backtrace shows that the variables are being passed through to the preview page.

Since this bug won't let me add a conference it renders the site unusable...so I've bumped it up to "critical".

#3

Roger Saner - January 14, 2008 - 23:57
Title:missing argument error on conference creation preview» Invalid argument supplied for foreach() when previewing a Conference

I've just download the latest version from cvs (v 1.10 2007/12/24 17:15:22) and the bug is still there, although this time on line 948 (still the same function). The version I was previously using was v 1.1 2007/07/27 01:28:34

#4

thijsvdanker - February 13, 2008 - 13:13

I'm having the same problems as above, using the v1.11 on 29/12/2007 (although text says 1.10)
I've installed fresh numourus times, and can't get past the first conference webform, so the site is useless

#5

Bèrto ëd Sèra - July 31, 2008 - 19:07
Priority:critical» minor

This is not a bug, but a wrong coupling of modules. The webform module has moved to a 5-x.2 version that is now recommended. Yet this version has big changes in its API, so it won't work. Choosing to use 5.x-1.10 will produce better results, but it's still not enough to make it work, because alterations in the webform API where already in progress even in the 5-x.1 branch. Notably, you'll have problems with

function webform_get_cid($node, $form_key, $pid) {
  foreach ($node->webformcomponents as $cid => $component) {
    if ($component['form_key'] == $form_key && $component['parent'] == $pid) {
      return $cid;
    }
  }
}

where the $pid param was unknown at the time in which the conference_organizing module was issued. The module will allow you to insert a conference if you choose this version of webform, but many things will still be broken. I'll try and see if we can trace a previous version of webform that can solve the problem.

#6

Bèrto ëd Sèra - July 31, 2008 - 20:32
Status:active» closed

Solved. On install you should choose webform-5.x-1.7.tar.gz this seems to work fine.

#7

Bèrto ëd Sèra - July 31, 2008 - 20:33
Assigned to:Anonymous» Bèrto ëd Sèra
 
 

Drupal is a registered trademark of Dries Buytaert.