Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 6640 of /home/andy/d7sandbox/drupal/includes/common.inc).

Comments

usonian’s picture

Probably due to er_FOO_instance tables being built on the fly; need to see how best to tell the system about them

eustace’s picture

Version: » 7.x-1.x-dev

Seeing same too. Any ideas how to handle it?

eustace’s picture

I debugged and found my problem to be coming from a typo in an install file I created. I have a multi table implementation of hook_schema and mistyped one of the table names such that the name was no longer consistent with its use within the corresponding .module file. This resulted into the passing of NULL instead of field listing for this table as part of the content of the $table argument of function drupal_schema_fields_sql() defined in common.inc. Correcting the typo eliminated the warning message. Highly repeatable.

mgifford’s picture

I just got the same error:
Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 6751 of /DRUPAL7/includes/common.inc).

Expect it's likely a similar typo, but not sure how best to track it down.

alan d.’s picture

In line 6751 of /DRUPAL7/includes/common.inc (just remember to remove it afterwards!)

if (!is_array($schema['fields'])) {
  die($table);
}
kristen pol’s picture

Based on reading other issues, a call to:

drupal_get_schema(NULL, TRUE);

or

drupal_get_schema('tablename', TRUE);

should help get the schema updated so that drupal_schema_fields_sql() doesn't complain. The trick will be to find where to put the code.