I have a number of views blocks that display items in a nodequeue. Unfortunately, when a queue is edited, it does not update the nodes, therefore the block cache does not expire. We are able to use time based caching to solve this, but since the nodequeues rarely change, it would be more ideal to dump the cache based on when the nodequeue is edited.

Comments

swentel’s picture

Nodequeue exposes enough hooks to implement this request (nodequeue_add and nodequeue_remove). I'll post a patch somewhere next week to support this.

swentel’s picture

Status: Active » Fixed

Committed this to the dev branch, should work properly. Let me know after some testing and I'll push a new release pretty soon after that.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

csavio’s picture

This is a great change. I also really like the hook that was added in dev.

I've been testing the dev version locally with nodequeue. I'm having a bit of a problem, with a nodequeue though. An anonymous user block is set to cache globally and clear both block and page cache with nodequeue additions and removals, but the page is not updating for the anonymous user. The authenticated user block updates with nodequeue changes correctly.

The standard node block cache clearing works perfectly for authenticated and anonymous users and appears to use the same logic as the nodequeue changes, so I'm not sure where the issue is. I walked through the code in a debugger and updating the anonymous nodequeue is definitely triggering the _blockcache_alter_nodequeue_cleanup and the cache_clear_all with the correct $sqid.

The view and view output is not cached and the block is only cached through the block page. Can you think of a reason nodequeue view block changes would be reflected for authenticated users, but not anonymous?