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.
Any chance of building support for EntityCache? It might prove useful.
Comment | File | Size | Author |
---|---|---|---|
#11 | entity_cache.patch | 3.53 KB | fago |
#2 | entity-1111120-3-support-for-entitycache.patch | 3.29 KB | jamsilver |
#2 | entity-1111120-3-support-for-entitycache.no-prefix.patch | 2.92 KB | jamsilver |
Comments
Comment #1
fagoyep, I'd like to see that happen asap. Any tackers?
Comment #2
jamsilver CreditAttribution: jamsilver commentedOK, here is a very rudimentary attempt to make 'entity cache' something pluggable and delegates calls to it in all the moments entitycache seems to need them at the moment.
Pretty sure this works at the moment if entitycache's
EntityCacheControllerHelper
is passed as the 'entity cache' value inhook_entity_info_alter()
as long asEntityCacheControllerHelper
's methods are changed from protected to public.Comment #3
plachCrosslinking: #1165930: Compatibility with Entity API.
Comment #4
fagopatch looks good to me. I guess we should add some usage instructions to the README?
Comment #5
quartsize CreditAttribution: quartsize commentedIs it support specifically for Entity cache that is desired, or persistent caching for
EntityAPIController
, withEntityCacheControllerHelper
as a means to that end?Comment #6
Fidelix CreditAttribution: Fidelix commentedDefinitely subscribing!
I'm coming from this issue: #1165930: Compatibility with Entity API
Comment #7
jamsilver CreditAttribution: jamsilver commented@quartsize: the approach I took was the more general one. So this patch works persistent caching into EntityAPIController delegating everything to the class found in the 'entity cache' property of the entity info.
Which allows the persistent cache handler to be swapped out if necessary.
Having said that, I made it work with EntityCache in mind, I haven't thought about what other persistent caching mechanisms may exist and may require so any thoughts you have about making it sufficiently flexible are welcome =)
Note, the complimentary issue on entitycache module has been committed (#1165930: Compatibility with Entity API)
Comment #9
andypostSo only README lines are should be done to make this happen. Seem this patch needs reroll but let's test it.
#2: entity-1111120-3-support-for-entitycache.patch queued for re-testing.
Comment #10
fagoentity cache module defines the entity cache property as TRUE / FALSE - let's follow that and just use the class provided by the entity cache module.
Also I'm not keen on introducing a 'entity cache' property supporting arbitrary classes or without any interface or base class to extend. The latter could already be considered bad practice...
Comment #11
fagook, I've implemented it that way and committed it. See attached patch.
Comment #12
amateescu CreditAttribution: amateescu commentedI can't see this in the repository.. maybe you forgot to push? :)
Comment #13
fagoexactly.. sry, pushed it now.