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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TorreyToomajanian created an issue. See original summary.

TorreyToomajanian’s picture

Issue summary: View changes
TorreyToomajanian’s picture

Patch 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.