I'm getting a ton of these on a view page:
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 188 of includes/entity.inc). Backtrace:
array_flip(Array) entity.inc:188
DrupalDefaultEntityController->load(Array, Array) common.inc:7623
entity_load('taxonomy_term', Array) relation_entity_collector.module:457
relation_entity_collector_views_post_execute(Object) view.inc:1108
view->execute(NULL) view.inc:1118
view->render() views_plugin_display_page.inc:224
views_plugin_display_page->execute() view.inc:1244
view->execute_display('page', Array) views.module:466
views_page('admin_taxonomy_sizes', 'page')
call_user_func_array('views_page', Array) menu.inc:516
menu_execute_active_handler() index.php:21
The reason is that my view is listing taxonomy terms in one vocabulary, with a relationship via a term reference field to terms in a second vocabulary. However, because the term reference field is not required, some rows have an empty value for the relationship term.
The problem is that the entity collector is not taking this possibility into account.
Comments
Comment #1
joachim commentedHere's a patch.
Comment #3
joachim commented*sigh*
Comment #4
marcus_clements commentedThis patch does indeed get rid of the warning but some nodes in $view->result don't get loaded because they don't have a matching alias. I haven't worked out if this is good or bad.
Comment #5
chx commentedThanks for the patch but I really would like to see a test before this goes in.
Comment #6
joachim commentedI'm really not sure what a test would need to test or how to go about testing it.
Is that really necessary for such a small fix?
Comment #7
joachim commentedHere's a reroll in the meantime.
Comment #8
pingers commentedLet's test the reroll - run into this too.
Comment #9
mikran commentedThere is just 1 test case for entity collector so yes, a test to verify that collecting from a basic view would be nice step ahead in that regard.
There are tests for relation views but entity collector module is not enabled during those tests. I don't see any reason why this couldn't be the case. For this spesific issue any view that produces the error should be added, if one does not exist yet.
#1809166: Warnings on entity collector closed as duplicate to this.
Comment #10
jos_s commented#7 works for me (version = "7.x-1.0-rc3").
Comment #11
mikran commentedHere are the tests with entity collector enabled. At least locally I got some results (errors)
Comment #13
kingswoodute commentedSubscribe. I get 18 of these errors in a view I am creating.
Thanks so much for the work you're doing. Relation is an amazingly good module!
Comment #14
mikran commentedCommitted 70700d3.