When viewing a node from a content type I created, this is the Warning:
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /path/to/drupal/includes/entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /path/to/drupal/includes/entity.inc).
What can I do so this warning disappears? or tell me where to post this if this has nothing to do with Entity API.
Also, This is happening after upgrade to Drupal 7.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | entity-array_flip_warning-1559516-12.patch | 2.14 KB | kimwes |
Comments
Comment #1
elnico commentedI'm having the same issue after upgrading core to 7.14
I will appreciate a solution that I can't find.
Thanks
Edit: Sorry, I din't ment to change your issue title, and can't revert. Original title: Warnings showing up after upgrade
Comment #2
jfha73 commentedNo problem, but since the warning is coming from the include folder in the Drupal core tree, I also posted it there, here is the link, let's see who answers first.
Warnings showing
Comment #3
jfha73 commentedWould you please confirm that this only appears in nodes of content types with link fields on it?
I just noticed that this is only happening when there is a link field in the node.
Comment #4
jfha73 commentedcould you confirm if this is only happening in nodes with link field on them?
Comment #5
designingsean commentedI am getting this error on pages where the content type has a node reference field, but no nodes have actually been referenced. If I add a node to the node reference, the error disappears. This began showing up after an upgrade to RC3 and Drupal 7.14. The full error is:
Notice: Undefined index: nid in entity_metadata_field_property_get() (line 406 of C:\inetpub\wwwroot\digitalcoast\sites\all\modules\entity\modules\callbacks.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of C:\inetpub\wwwroot\digitalcoast\includes\entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of C:\inetpub\wwwroot\digitalcoast\includes\entity.inc).
Comment #6
designingsean commentedSo I have more details on this. I rolled back to 7.12 and all the other modules back to their original, working state. I then started updating core to 7.13, and then each module individually.
Rolling up to RC3 DID NOT cause the error to appear. It wasn't until I updated Views Datasource to the latest version (Jan 23 2012 to June 5 2012) that the error showed up.
So, everyone else who is experiencing this error: Are you also running Views Datasource?
Comment #7
Anonymous (not verified) commentedI am getting "An internal server error occurred. Please try again later." while doing the database update following the update from 7.x.-1.0-rc1 to 7.x.-1.0-rc3.
Comment #8
jfha73 commentedI don't have Views datasource, I have never heard of it before and I started this topic.
I do have Views and Views UI enabled.
Comment #9
jfha73 commentedHas anybody had a breakthrough on this? or at least an idea of what's causing it?
IF somebody is working on this, please give us a status report.
Thanks.
Comment #10
kevinquillen commentedI too, get this error on occassion.
I currently cannot run any drush commands.
Comment #11
hiddenfellon commentedI am getting this error when I try to login on my site, I am now unable to login to me administer account for some reason...
Comment #12
kimwes commentedI believe that this drupal core issue is related: http://drupal.org/node/1102570#comment-6388004. In the comment is a patch to fix it.
I'm having the same problem with entity api with an error message: Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityAPIController->load() (line 184 of modules/contrib/entity/includes/entity.controller.inc).
I debugged the ids and they were having NULL values. This patch removes NULL values before flipping array.
Comment #13
jfha73 commentedI tried the patch, but I still get the warnings.
Comment #14
jfha73 commentedFYI, I also tried replacing:
array_flip($ids)for:
array_flip(array_filter($ids, 'strlen'))In includes/entity.inc (Core) for lines 178 and 354.
But it still shows the warnings, if there are any other ideas, please post it here, since the one I opened for the core has had no answers from anybody.
Comment #15
jfha73 commentedNever mind, I just noticed that I was not changing the right file (live) but my local file instead. it doesn't show the warnings when array_filter is added.
Comment #16
jfha73 commentedCan you guys tell us what module is causing this in your cases? to see if we can narrow this?
In my case I thought it was the link module but then I noticed it happens in nodes without link field on them.
Thanks.
Comment #17
jfha73 commentedHey guys, I just tried something else that worked too, you might want to try it too:
Go to Administration->structure->Content Types
Go to the Manage Display of the Content type that's giving you this warning
Change the Format of the Field(s) that you think might be causing this (in my case link, date and taxonomy)
Then bring it back to the setting you had it before, save it and try it now to see if it still shows you the warning.
Comment #18
jfha73 commentedjust closing it because the problem is not this module but the fields on content types.