After running cvs update this morning, I immediately started getting the repeated errors:
# Notice: Undefined index: view modes in _field_info_prepare_instance() (line 295 of /home/joshuarogers/drupal7/modules/field/field.info.inc).
# Warning: Invalid argument supplied for foreach() in _field_info_prepare_instance() (line 295 of /home/joshuarogers/drupal7/modules/field/field.info.inc).
Also, anything that is field no longer shows up. This includes node bodies.
After looking around for just a bit, it seems that the error is most likely coming from _field_info_collate_fields. Inside, field_read_instances is being called with no arguments, though the function itself has three required arguments and one optional. This bug effectively keeps all content (other than titles) from properly displaying.
Comments
Comment #1
catchhttp://api.drupal.org/api/function/field_read_instances/7 doesn't have three required arguments, it has two optional ones. Did you mean something else?
Comment #2
Anonymous (not verified) commentedHmm. It seems that I can't read (at least not before noon.) I'll try to find what I was looking at later when I get back to the house.
Comment #3
catchI've seen this error though, let's leave it a open for a bit to figure it out.
Comment #4
Anonymous (not verified) commentedI'm not actually sure what I was thinking for the first thing at top. I can only assume that I misread my trace. This time, I'm much more certain.
It seems that occassionally when _field_info_prepare_instance is called, $instance does not have a member 'entity_type'. When $instance['entity_type'] is used in a call to entity_get_info later in the function, NULL gets used instead (since it isn't defined.) entity_get_info returns a different value if entity_type is NULL. Thus, the foreach that expects $entity_info['view modes'] gets a different data structure passed to it.
Unfortunately, I'm not sure what is causing it to occassionally undefined.
Comment #5
yched commentedGuys, did you by any chance install and test #553298: Redesign the 'Manage Display' screen ? Fields created with this patch on will create such warnings when the code is back to current HEAD.
Comment #6
Anonymous (not verified) commentedI've not applied any custom patches. That would have made everything easier though.
Comment #7
johnalbinI'm seeing this bug as well. For the record, its been a while since I completely blew away my d7 database; I've been using update.php for a couple months now. And this error just popped up.
Comment #8
johnalbinhmm… When I went to admin/structure/types/manage/article/fields, I get this PHP failure:
And, indeed, my field_config_instance table does not have an entity_type column.
Found #707724: Call them entities instead of objects where the database change was introduced.
So this will bite people who are going to be migrating from Alpha 3 to Alpha 4. Do we want to fix it?
For those people getting PHP notices/failures because of the DB change introduced with this patch, you can use the following query to fix it in MySQL:
You'll need to clear the cache too.
Comment #9
yched commentedD7 -> D7 upgrade path is not supported until we reach RC.
Comment #10
gravit commentedThank you so much for tracking this down John - I ran into the same problem going from Alpha 3 to the Dev release when I needed to get the commits for views to not break the update.php routine...