Warning: array_flip() expects parameter 1 to be array, null given in DrupalCommerceEntityController->load() (line 143 of /profiles/commerce_kickstart/modules/contrib/commerce/includes/commerce.controller.inc).
Warning: array_diff_key(): Argument #1 is not an array in DrupalCommerceEntityController->load() (line 143 of /profiles/commerce_kickstart/modules/contrib/commerce/includes/commerce.controller.inc).
Warning: Invalid argument supplied for foreach() in DrupalCommerceEntityController->load() (line 143 of /profiles/commerce_kickstart/modules/contrib/commerce/includes/commerce.controller.inc).
PHP Warning is being thrown on my Commerce Kickstart site after installing Marketplace. I reported a similar error that I marked as related which was the result of an incorrect parameter being fed into commerce_order_load_multiple(). In this case, it is the first argument which is being passed NULL but should be passed an empty array instead. For this, I have changed:
Line 126: commerce_marketplace_order.module
return !empty($order_group) ? commerce_order_load_multiple(NULL, array('order_group' => array($order_group))) : array();
to:
return !empty($order_group) ? commerce_order_load_multiple(array(), array('order_group' => array($order_group))) : array();
I will read how to submit a patch and create one for both this error and the related one mentioned.
Comment | File | Size | Author |
---|---|---|---|
#3 | commerce_marketplace-pass_array_instead_of_null_argument-2677214-3-7.39.patch | 725 bytes | TorreyToomajanian |
Comments
Comment #2
TorreyToomajanian CreditAttribution: TorreyToomajanian as a volunteer commentedComment #3
TorreyToomajanian CreditAttribution: TorreyToomajanian as a volunteer commentedPatch fixes the faulty line of code by passing in an empty array() instead of NULL to commerce_order_load_multiple(). Also submitted a patch to the related issue I created and after reviewing the module and all submodules, I believe these are the only 2 instances of this issue. These are my 1st and 2nd patches so please let me know if there is anything I left out.