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."
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | search_api_acquia_2865469_5.patch | 989 bytes | geoffreyr |
| #3 | array_flip_warning-2865469-1.patch | 1.18 KB | jaheer3 |
Comments
Comment #2
jaheer3 commentedComment #3
jaheer3 commentedHi,
I have added the patch for the issue. Please Review.
Comment #4
jaheer3 commentedComment #5
geoffreyr commentedHere'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.
Comment #7
janusman commentedLooks good! Pushed to 7.x-2.x
Comment #9
hesnvabr commentedThis 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