can anyone confirm this log entry/error?

Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityCacheControllerHelper::entityCacheLoad() (Zeile 69 von /var/www/test/sites/all/modules/contrib/entitycache/entitycache.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jpstrikesback’s picture

I'm seeing this when I delete certain video file items from a node, here is the trace:

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /srv/bindings/blah/code/includes/entity.inc). Backtrace:
array_flip(Array) entity.inc:355
DrupalDefaultEntityController->cacheGet(Array, Array) entitycache.module:68
EntityCacheControllerHelper::entityCacheLoad(Object, Array, Array) entitycache.module:199
EntityCacheNodeController->load(Array, Array) common.inc:7729
entity_load('node', Array, Array, ) node.module:909
node_load_multiple(Array) views_plugin_row_node_view.inc:98
views_plugin_row_node_view->pre_render(Array) views_plugin_style.inc:307
views_plugin_style->pre_render(Array) view.inc:1236
view->render() views_plugin_display_block.inc:54
views_plugin_display_block->execute() view.inc:1337
view->execute_display('block_1') views.module:703
views_block_view('some_listing_videos-block_1')
call_user_func_array('views_block_view', Array) module.inc:833
module_invoke('views', 'block_view', 'some_listing_videos-block_1') block.module:854
_block_render_blocks(Array) context_reaction_block.inc:392
context_reaction_block->block_list('page_top') context_reaction_block.inc:354
context_reaction_block->block_get_blocks_by_region('page_top') context_reaction_block.inc:223
context_reaction_block->execute(Array) context.core.inc:258
context_page_build(Array) common.inc:5704
drupal_render_page(Array) common.inc:2656
drupal_deliver_html_page(Array) common.inc:2544
drupal_deliver_page(Array, '') menu.inc:532
menu_execute_active_handler() index.php:21

In my case this was to do with the Video module and how it was using drupal_write_record I believe. It is fixed now i believe by Video using file_save. Interestingly the items that were saved to the node via entity refs before the fix are still affected...even after deleting them...

kaizerking’s picture

same error here too

jpstrikesback’s picture

Kaizerking, I was looking at this again on Friday and noticed that in my view it was outputting a node created timestamp, and two empty reference fields, thus sending Entity Cache a NULL value to array_flip on, I'll be digging more today or tmrw, but I'm just wondering, are you seeing this in conjunction with a view?

kaizerking’s picture

jpstrikesback, I am getting this error on enabling the module,
So I am not sure what is triggering this

j0rd’s picture

@jpstrikesback for me I'm getting it from an ajax call. I don't believe it's got a view.

j0rd’s picture

phayes’s picture

Status: Active » Needs review
FileSize
648 bytes

Attached is a patch that fixes this.

Status: Needs review » Needs work

The last submitted patch, entitycache.1795918.patch, failed testing.

phayes’s picture

Status: Needs work » Needs review

Test failed because of unrelated problem:

Fatal error: Class 'NodeAccessRecordsUnitTest' not found in /var/lib/drupaltestbot/sites/default/files/checkout/sites/default/modules/entitycache/entitycache.test on line 261].

jpstrikesback’s picture

#7: entitycache.1795918.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, entitycache.1795918.patch, failed testing.

k.skarlatos’s picture

With this patch i get this warning:

Warning: array_filter() expects parameter 1 to be array, null given in EntityCacheControllerHelper::entityCacheLoad() (line 64 of /var/www/clients/client1/web2/web/sites/all/modules/entitycache/entitycache.module).

holtzermann17’s picture

Status: Needs work » Needs review
FileSize
737 bytes

Attached patch combines the idea from #7 and the comment from #12.

Status: Needs review » Needs work

The last submitted patch, entitycache-oneliner-1695918-13.patch, failed testing.

Dave Reid’s picture

Dave Reid’s picture

Nevermind, it looks like entitycache needs to fix this core bug as well. Let's instead merge this with #1851398: PDOException:Invalid text representation when attempting to load an entity with a string ID which has a more detailed patch in progress.

hansrossel’s picture