I've the following warning on Cart page having a product:

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

I don't know exactly what cause the problem, but the following code generating this warning:

function commerce_webform_form_views_form_commerce_cart_form_default_alter(&$form, &$form_state, $form_id) {
...
  foreach (element_children($form['edit_quantity']) as $id) {

And NULL is passed into element_children().
Probably because my Quantity is read-only (just plain text, not textfield), so edit_quantity key doesn't exist?

Quantity field

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenorb’s picture

Issue summary: View changes
kenorb’s picture

vpshah86’s picture

Assigned: Unassigned » vpshah86
vpshah86’s picture

Assigned: vpshah86 » Unassigned
Status: Active » Needs review
FileSize
3.62 KB

I have applied patch for php warning

sandipshirsale’s picture

Status: Needs review » Reviewed & tested by the community

#4 works for me

vpshah86’s picture

@kenorb,

any updates on this issue.

Have you reviewed my patch?

Thanks

kenorb’s picture

@vpshah86 Sorry, I cannot, I'm not using Commerce Webform in my current project.