After updating module to version 2.3 5 out of 10 sites display the following warnings when trying to run database updates:

Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityAPIControllerExportable->load() (line 742 of .../sites/all/modules/entity/includes/entity.controller.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityAPIController->load() (line 219 of .../sites/all/modules/entity/includes/entity.controller.inc).

The error is not present if the version is 7.x.-2.1. No other changes have been done to the sites.

I asked our development vendor to take a look, here are their findings:
"1. search_api_acquia module which is calling
search_api_server_load_multiple()

2. search_api module which is calling
search_api_index_load_multiple()

the functions are getting called with wrong parameter types, while entity_load() the final function call in call trace expects the arguments to be array, #1 #2 are calling with boolean arguments as FALSE, since the core does not get affected by the wrong typed argument but the condition check throws a warning."

Comments

anikadark created an issue. See original summary.

jaheer3’s picture

Assigned: Unassigned » jaheer3
jaheer3’s picture

StatusFileSize
new1.18 KB

Hi,
I have added the patch for the issue. Please Review.

jaheer3’s picture

Assigned: jaheer3 » Unassigned
Status: Active » Needs review
geoffreyr’s picture

StatusFileSize
new989 bytes

Here's another patch which shifts the fix to search_api_acquia, specifically to avoid loading servers with no machine name. We've hit this exact use case while waiting for Acquia to provision our Solr instance, and have been plagued with array_flip warnings with no specific source. Glad to get this one squashed.

  • geoffreyr authored b21acc6 on 7.x-2.x
    Issue #2865469 by jahirul.islam@srijan.in, geoffreyr: Getting Warning:...
janusman’s picture

Status: Needs review » Fixed

Looks good! Pushed to 7.x-2.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

hesnvabr’s picture

This issue or the patch in comment #5 fix the warning caused at search_api_acquia level but not in general below is the link to fix the issue at search_api warnings.

https://www.drupal.org/node/2881111