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.
Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 6755 of /opt/difang/dev/pjkaixin/includes/common.inc).
The warning shows after enabled the module.
Comment | File | Size | Author |
---|---|---|---|
#7 | eck_bug1.png | 228.87 KB | farhadhf |
#7 | eck_bug.png | 225.43 KB | farhadhf |
Comments
Comment #1
mgiffordSee http://drupal.org/node/1077382#comment-4233968
Comment #2
fmizzell CreditAttribution: fmizzell commentedok, I just did a couple of tests trying to find the warning. First I checked on some site I had set up already (drupal 7.4, didn't look at what version of ctools or entity I had installed) and I did not see the warning. Then I installed a new site (drupal 7.10, entity 7.x-1.0-rc1, ctools 7.x-1.0-rc1) and I did not see the warning on that set up either.
If you can let me know what version of this modules you are using, and what version of drupal, I can do a more accurate test. Also try the latest version to see if the problem is present there too.
Comment #3
fmizzell CreditAttribution: fmizzell commentedComment #4
ryan.armstrong CreditAttribution: ryan.armstrong commentedUsing Drupal 7.12, ctools 1.0RC1, and ECK 2.0 Alpha 1 and I get this error when enabling. I'll try the dev version.
Comment #5
ryan.armstrong CreditAttribution: ryan.armstrong commentedThe dev release of ECK does the same thing. I only get this when I enable the ECK Example module, not the core ECK module.
Comment #6
farhadhf CreditAttribution: farhadhf commentedHi,
I have the same problem with the module I'm working on: http://drupal.org/sandbox/farhadhf/1445190
To reproduce, Install the latest version of the commerce_kickstart distribution (or install commerce modules by hand on a clean drupal installation), then install and enable the this module.
Farhad
Comment #7
farhadhf CreditAttribution: farhadhf commentedOK, I did some investigation on this bug...
Here is my code,
field_create_field() calls entity_get_info() on line 91 of field.crud.inc, entity_get_info() calls drupal_schema_fields_sql('eck_commerce_auction_bid') on line 7448 of common.inc, drupal_field_schema_fields_sql() calls drupal_get_schema('eck_commerce_auction_bid') on line 6841 of common.inc which returns FALSE, causing array_keys to generate a warning on lne 6842 of common.inc ...
xdebug screenshots are attached.
Comment #8
farhadhf CreditAttribution: farhadhf commentedIn drupal_get_schema(),
$schema does not contain the schema of 'eck_commerce_auction_bid',
This seems to be database query caching problem...UPDATE: The entity_type is saved in the database right after save() is called, so it can't be a query caching problem. Any ideas?
Comment #9
fmizzell CreditAttribution: fmizzell commentedwe need to refresh the schema after an entity type gets save so we won't run into this problem
Comment #10
longwaveAdding
drupal_get_schema(NULL, TRUE);
after calling $entity_type->save() fixes it for me, so this could presumably be added at the end of EntityType::save().Comment #11
fmizzell CreditAttribution: fmizzell commented@longwave: that is what @farhadhf and I figure out, and that is exactly what I was planning to do, good thing you documented though, maybe noone else will waste time that way :)
Comment #12
fmizzell CreditAttribution: fmizzell commented