array_key_exists() expects parameter 2 to be array, null given in commerce_cart_add_to_cart_form() (line 2072

  • Notice: Undefined index: attributes in commerce_cart_add_to_cart_form() (line 2072 of /home/nginx/domains/hupuu.com/public/profiles/commerce_kickstart/modules/contrib/commerce/modules/cart/commerce_cart.module).

  • Warning: array_key_exists() expects parameter 2 to be array, null given in commerce_cart_add_to_cart_form() (line 2072 of /home/nginx/domains/hupuu.com/public/profiles/commerce_kickstart/modules/contrib/commerce/modules/cart/commerce_cart.module).

升级commerce_kickstart 到 7.x-2.51 后出现的bug

7.x-2.51 Stable release covered by the Drupal Security Team released 16 December 2017

✓ Recommended by the project’s maintainer.

Dependency updates


参考地址: https://www.drupal.org/project/commerce/issues/2924792

修复patch: https://www.drupal.org/files/issues/array_key_exists_error-2924792-6.patch

命令:

cd profiles/commerce_kickstart/modules/contrib/commerce

wget https://www.drupal.org/files/issues/array_key_exists_error-2924792-6.patch

patch -p1 < array_key_exists_error-2924792-6.patch

重启php