Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#4 | Commerce_Webform-php_warning_invalid_argument-2317249-3.patch | 3.62 KB | vpshah86 |
Comments
Comment #1
kenorb CreditAttribution: kenorb commentedComment #2
kenorb CreditAttribution: kenorb commentedComment #3
vpshah86 CreditAttribution: vpshah86 at Clarion Technologies commentedComment #4
vpshah86 CreditAttribution: vpshah86 at Clarion Technologies commentedI have applied patch for php warning
Comment #5
sandipshirsale CreditAttribution: sandipshirsale at Clarion Technologies commented#4 works for me
Comment #6
vpshah86 CreditAttribution: vpshah86 at Clarion Technologies commented@kenorb,
any updates on this issue.
Have you reviewed my patch?
Thanks
Comment #7
kenorb CreditAttribution: kenorb commented@vpshah86 Sorry, I cannot, I'm not using Commerce Webform in my current project.