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.
Problem/Motivation
I wanted to subscribe to an event after a tag was invalidated
Proposed resolution
add in an event dispatch before and after tags would be invalidated.
Remaining tasks
- Idea needs to be sanity checked, I am relatively new to Drupal and not sure if this is the best way to achieve this.
- reviews needed
- tests to be written or run
- documentation to be written
User interface changes
none
API changes
Added two new event names
CacheEvents::BEFORE_TAGS_INVALIDATED
CacheEvents::AFTER_TAGS_INVALIDATED
Data model changes
none
Patch to follow
Comments
Comment #2
Gravypower CreditAttribution: Gravypower commentedComment #3
cilefen CreditAttribution: cilefen commentedComment #5
Gravypower CreditAttribution: Gravypower commentedCreated patch correctly this time (hopefully)
Comment #6
cilefen CreditAttribution: cilefen commentedComment #8
Gravypower CreditAttribution: Gravypower commentedUpdated Unit Tests as they did not expect CacheTagsInvalidator to have a constructor argument.
Comment #9
Gravypower CreditAttribution: Gravypower commentedComment #11
BerdirWe already support tagged services, cache_tags.invalidator.checksum uses that for example. There is no explicit before/after, but there is support for priority, so if you want to be the first/last, you can set a very high/low priority.
Comment #21
smustgrave CreditAttribution: smustgrave at Mobomo commentedIf still a valid feature request please reopen addressing #11.