Problem/Motivation

Follow-up to #1268620: Use Entity Cache in Field Collection

The current solution doesn't update hook_schema(). The way that og and fieldable_panels_panes works around this is by adding something to their hook_schema to list support for entitycache. Let's do the same here. This is particularly a problem for me where I'm trying to build a filtered db dump of the site using the data from drupal_get_complete_schema(), which isn't providing accurate details since cache_entity_field_collection_item isn't returned.

Proposed resolution

Follow the approach used by og & fpp.

Remaining tasks

Review time!

User interface changes

n/a

API changes

n/a

Data model changes

yes, adds some things to hook_schema that were already created by entity module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

heddn created an issue. See original summary.

heddn’s picture

heddn’s picture

Issue summary: View changes
Status: Active » Needs review
davide.taibi’s picture

Is there any news on this issue?
We have a content type with several Fields Collections (a total or nearly 900 fields) that require nearly 90 seconds only to load.
Is there any safe workaround or patches I can apply to the content type to cache the generation of the page?

delacosta456’s picture

hi
hello .. yes please is there any update about this please

thanks

joelpittet’s picture

  if (module_exists('entitycache')) {
    $schema['cache_entity_field_collection_item'] = drupal_get_schema_unprocessed('system', 'cache');
    $schema['cache_entity_field_collection_item']['description'] = 'Cache table used to store field_collection_item entity records.';
  }

Maybe I can add to this to help out entity cache with this patch to clear it like og and fieldable_panels_panes does when cache is cleared.

joelpittet’s picture

FileSize
1.78 KB
1.82 KB

The difference between the others is that the creation of that table is not dependent on the entitycache module existing. Adding an extra cache table doesn't really need a module_exists check and makes things more complicated when it comes to which came first...

This is more in line with @heddn's original patch.

I fixed a double space in my patch too (thanks @jplana)

joelpittet’s picture

Still applies cleanly with the latest release

ilgnerfagundes’s picture

Status: Needs review » Needs work
FileSize
28.52 KB

The patch must be updated, it does not apply

ilgnerfagundes’s picture

Status: Needs work » Needs review
FileSize
1.77 KB

I recreated the patch

ilgnerfagundes’s picture

You can test my patch please, I was wrong I was in the correct branch