Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I got a bunch of notice and warning messages before I flush all cache in Drupal. These messages disappear after flushing cache.
Notice: Undefined index: bundles in field_info_bundles() (line 576 of /***/modules/field/field.info.inc).
Warning: Invalid argument supplied for foreach() in _field_info_collate_fields() (line 215 of /***/dev/modules/field/field.info.inc).
Notice: Undefined index: view modes in _field_info_prepare_instance() (line 306 of /***/modules/field/field.info.inc).
Warning: array_keys() [function.array-keys]: The first argument should be an array in _field_info_prepare_instance() (line 306 of /***/modules/field/field.info.inc).
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in _field_info_prepare_instance() (line 306 of /***/modules/field/field.info.inc).
Notice: Undefined index: view modes in field_view_mode_settings() (line 661 of /***/modules/field/field.module).
Warning: Invalid argument supplied for foreach() in _field_info_prepare_instance() (line 308 of /***/modules/field/field.info.inc).
Notice: Undefined index: schema_fields_sql in DrupalDefaultEntityController->buildQuery() (line 265 of /***/includes/entity.inc).
Recoverable fatal error: Argument 2 passed to SelectQuery::fields() must be an array, null given, called in /***/includes/entity.inc on line 284 and defined in SelectQuery->fields() (line 1320 of /***/includes/database/select.inc).
Some of these messages are similar to issue #1210178: Undefined Index bundles in field_info_bundles()
Drupal 7.8
Comments
Comment #1
Balbo CreditAttribution: Balbo commentedSimilar here:
(3 times the same warning)
Comment #2
aangel CreditAttribution: aangel commentedI was getting the same error trying to get Entity 1.0 and Profile2 beta 10 to work together. Uprading to the dev version of Oct 7 made the error go away for me.
Comment #3
Refineo CreditAttribution: Refineo commentedThanks, I will test Entity dev of Oct 7 and Profile2 1.0 now.
Comment #4
alalamo CreditAttribution: alalamo commentedI am not using either the Entity 1.0 API module or Profile2 module, and started getting this error this morning:
Recoverable fatal error: Argument 2 passed to SelectQuery::fields() must be an array, null given, called in C:\inetpub\wwwroot\includes\entity.inc on line 284 and defined in SelectQuery->fields() (line 1320 of C:\inetpub\wwwroot\includes\database\select.inc).
The problem must be in Core Entity system, and not caused by a contributed module. Any ideas as to what is going on?
Comment #5
wjaspers CreditAttribution: wjaspers commented@TainoTechy, there's a patch out there by @rfay, if I can find it. Basically, the core entity system doesn't check if an array is passed to ->fields(). If any EntityFieldQuery or SelectQuery tries to use this without a valid list of fields, it will substitute NULL and crash...
Comment #6
mcjim CreditAttribution: mcjim commentedThink this is the patch: http://drupal.org/node/1158114#comment-4863562
Comment #7
alalamo CreditAttribution: alalamo commentedIt appears that I stopped getting entity system errors when I updated to 7.9.
Thanks!
Comment #8
wjaspers CreditAttribution: wjaspers commentedMarking as fixed, since this appears to be resolved in 7.9 and later.
Comment #9
mgiffordI'm getting a very similar error in 7.9 - the patch by @mcjim wasn't rolled into core yet.
Comment #10
wjaspers CreditAttribution: wjaspers commentedComment #11
srlawr CreditAttribution: srlawr commentedI was getting this problem a lot in D 7.12 whenever installing new modules or flushing the cache.
It comes after about a dozen error messages reading:
Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 6842 of \includes\common.inc).
I tried reversing out some contrib modules to eliminate the problem, and saw I could actually remove Rules, as it wasn't in use, but by doing so I have completely broken my site to the message reported in this issue. Even re-enabling Rules via the DB.system table won't bring it back.. problematic.
Comment #12
SMartin CreditAttribution: SMartin commentedHi,
(Newb Alert...)
(I seem to have changed the title of this issue. Really sorry... Can't seem to change it back)
Is this issue still unresolved?
When I try to add a new page of content on my D 7.17 site I get two errors:
1) Warning: array_keys() [function.array-keys]: The first argument should be an array in drupal_schema_fields_sql() (line 6969 of /home/****/public_html/****/includes/common.inc).
2) Recoverable fatal error: Argument 2 passed to SelectQuery::fields() must be an array, null given, called in /home/***/public_html/***/includes/entity.inc on line 284 and defined in SelectQuery->fields() (line 1300 of /home/****/public_html/****/includes/database/select.inc).
When I clear caches I get error 1) on the "Performance" page. I still get both errors when I try to add content.
I *was* also getting error 1) on the 'Modules' page but no longer...
I'm not even sure the two errors are related to be honest...
If I disable the entity api module the errors persist even after clearing caches.
Hope someone can help... At the moment I can't add anything to my site.
I'm not able to apply patches due to my hosting environment but I could perhaps make manual changes to files if I knew what needed to be done...
Thanks :-)
S
Comment #13
SMartin CreditAttribution: SMartin commentedHi,
I got myself together and applied the patch mentioned in #6 locally and then uploaded to the server...
My error 2) Recoverable fatal error: Argument 2 passed to SelectQuery::fields() must be an array, null given, called in /home/***/public_html/***/includes/entity.inc on line 284 and defined in SelectQuery->fields() (line 1300 of /home/****/public_html/****/includes/database/select.inc).
is now gone!
I still get 1) Warning: array_keys() [function.array-keys]: The first argument should be an array in drupal_schema_fields_sql() (line 6969 of /home/****/public_html/****/includes/common.inc).
twice on the "Performance" page when I clear caches and once when I try to create new content.
At least the new content page loads now, which it wasn't before...
s
Comment #14
rooby CreditAttribution: rooby commentedClosing as duplicate of #1158114: SelectQuery::fields() must be an array, null given entity.inc on line 284 SelectQuery->fields() (line 1262 select.inc