Problem / Motivation
I digged in the database to verify if the cache exclude settings work. And surprisingly they didn't.
My (custom) entities always got cached. Also I the tests for this module fail, when running against 8.7.
Proposed solution
My investigations lead me to the fact that the persistent_cache setting was not changed anymore, in the storage controller.
And then I found this issue: #2554235: Make the content entity storage and entity query use the last installed definitions instead of the ones living in code
Quickfix
This led me to also change the Active Definition in field_encrypt_entity_type_alter, which made it work again.
Conceptually I think the code from hook_entit_preprocess should be executed, when config is saved, in the already existing config listener. IMO static cache can also be removed, or exposed as (super secure) setting, see also: #3073924: Improve how the effects on cacheability are controlled
Open questions
- Maybe a more generic way needs to be provided by core (probably other modules implementing hook_entity_type_alter will fail too).
- Unsure about the field manager definition, do they need to be updated too?
- Is the try/catch block enough to ensure backwards compability?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3081143-core_8_7_compability-5.patch | 1.1 KB | ytsurk |
Comments
Comment #2
ytsurkComment #3
ytsurkComment #4
ytsurkComment #5
ytsurkComment #6
ytsurkComment #7
ytsurkComment #8
alexpottI've merged this with #3124830: Fix project on Drupal ^8.7 and fix failing tests on 8.x-2.x as both are need to for this module to be testable. I've asked for @ytsurk to have credit in the other issue. This is an important fix. They way the other issue fixes it is a little bit different worth having a look at.