- First commit to issue fork.
- @admirlju opened merge request.
This was more work than expected. Since the patch fails to apply I coded it by hand. The thing is this patch worked only for entity types of Node, while the module is supposed to support any entity type, also implemented it using dependency injection. Fixed the tests and added doc comments.
There is also a similar fix in 📌 Disabled page caching Needs review but using a different event. That one adds content to a recently read table on KernelEvent::REQUEST, so they are added before the page is loaded to the client, I go a bit into details in comment #11.
- Status changed to Needs work
over 1 year ago 1:59pm 8 September 2023 Okay, so it looks like this will not work for anonymous users, at least not after the first session is created in
recently_read_entity_view()
. This happens becausehook_entity_view()
runs only when the view is not cached. So this will have to be moved somewhere else.- Status changed to Needs review
over 1 year ago 7:32am 11 September 2023 I moved the anonymous session check to an event subscriber, that runs on KernelEvents::REQUEST on priority 27. This way the session check for anonymous users gets done even if the page is already cached.