Hi,
I got this error while using this module in a multi-page form.

Warning: Invalid argument supplied for foreach() in element_children() (line 6557 of /includes/common.inc).

After exploring the code, I found that the following code in line 157 in webform_addmore.module file is responsible for the error:

foreach (element_children($element) as $key) {
        _webform_addmore_client_form_ajaxify($element[$key], $form_state);
      }

The error arises when the webform page element is passed to the function thus producing empty element which throws error in element_children function of common.inc

Attached is the patch to fix this.

Comments

Ismail Cherri created an issue. See original summary.

ismail cherri’s picture

ismail cherri’s picture

Status: Active » Needs review
nicrodgers’s picture

Status: Needs review » Reviewed & tested by the community

I could replicate the same behaviour. Patch applied successfully and fixes the issue. RTBC. Nice one, Ismail!

bellesmanieres’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Commited to 7.x-2.x, thanks