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 |
|---|---|---|---|
| #2 | array_flip_warning-2865469-1_1.patch | 1.18 KB | hesnvabr |
Comments
Comment #2
hesnvabr commentedHi,
I have added the patch for the issue. Please Review.
Comment #4
arpitr commentedComment #5
drunken monkeyFirst off: Version 2.3 of what? Search API doesn't have such a module version, nor does any related module I can think of at the moment.
Second: I don't know which Drupal version you're using, but as far as I know, the signature for
entity_load()has always (OK, since #932016: DX: entity_load() defaults are useless (Beta 1)) looked like this:So,
$idsis definitely allowed to beFALSE, it means "load all entities". Yes,NULLwould make much, much more sense, and it's even that in Drupal 8, but in Drupal 7, it's like this.Comment #6
hesnvabr commentedversion 2.3 of search_api_acquia i.e 7.x-2.3.
And the drupal version is 7.52.
Comment #7
drunken monkeyIf it started to fail after an update to search_api_acquia, it seems more reasonable to report the bug there?
The analysis of your "development vendor" is rubbish, in any case.
Comment #8
drunken monkeyComment #9
hesnvabr commentedThis issue was already fixed in latest version.