Upgrade to 3.11 caused all views to disappear from one of our sites.

After some debugging we found that one of our custom modules in hook_views_data() calls field_info_extra_fields().
We also use eva module, which calls eva_get_views() in eva_field_extra_fields(). This causes _views_fetch_plugin_data() to be called recursively at the point then the static variable $cache is already set but is still empty. As a result this empty cache is returned, causing part of views data to be empty.

Attached patch fixes the issue.

CommentFileSizeAuthor
views.fix_empty_cache.patch517 bytestatyana
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, views.fix_empty_cache.patch, failed testing.

matthiasm11’s picture

Status: Needs work » Reviewed & tested by the community

I can confirm the patch works. Thanks!

colan’s picture

We've recently switched our testing from the old qa.drupal.org to DrupalCI. Because of a bug in the new system, #2623840: Views (D7) patches not being tested, older patches must be re-uploaded. On re-uploading the patch, please set the status to "Needs Review" so that the test bot will add it to its queue.

If all tests pass, change the Status back to "Reviewed & tested by the community". We'll most likely commit the patch immediately without having to go through another round of peer review.

We apologize for the trouble, and appreciate your patience.

matthiasm11’s picture

Use this patch with caution. It broke some of our views (in combination with search api).

Our problem

The implemented mymoduly_field_info_extra_fields() was called during the building of cache. This hook contained an entity_load, which tried to rebuild the cache too, but $cache was still FALSE in _views_fetch_plugin_data(). => Recursive building of the cache.

Our solution

We replaced the entity_load in mymoduly_field_info_extra_fields() with a custom db_select(), so the caching part is skipped. Since hook_field_info_extra_fields() is only called after a cache clear, the performance should stay the same. Or even better because we do not load the whole entity, but just one field.

matthiasm11’s picture

Status: Reviewed & tested by the community » Needs work