Drupal, invalid arguments supplied for foreach

时间:2018-07-24 10:10:03

标签: foreach drupal-7 drupal-commerce

I'm using Drupal Commerce and when I use some methods (the commerce_fees ones) I have this error :

Warning : Invalid argument supplied for foreach() dans commerce_discount_usage_order_discounts() (ligne 1083 dans /var/www/clients/client1/web84/web/sites/all/modules/contrib/commerce_discount/commerce_discount.module).

How can I avoid that ? The error comes from a contrib module, I can't edit it. And the values that I give to the functions are good, it's just the order and I get it like this :

$order = commerce_order_load($order_id);

Anyone know how to fix this ? Or maybe hide the warnings ?

1 个答案:

答案 0 :(得分:1)

您正在使用模块的旧版本。 (Alpha8)的外观HERE

将该模块更新为最新版本(当前为(7.x-1.0-beta5))。

如果仍然出现错误,请将其报告给模块发布队列HERE