misterbisson/bcms — pull request #34 by borkweb (2013-09-09 19:59:29+00:00)
Title: Fixing related-to caching bug

__Problem:__

When a postloop widget (widget A) is cached, it doesn't store the post IDs that were cached.

__What happens:__

When postloop widget (widget B) that has a relation to widget A, its `$criteria['post__*']` is built based on the post_ids that exist in widget A. The criteria array is used during the generation of the `$cachekey`, which is used to retrieve postloop cache data.

Because of the dependency on post_ids of cached widget A (and their non-existence when widget A is pulled from cache), the `$criteria['post__*]` variables are not set, thus resulting in a different `$cachekey` and - with the absence of `$criteria['post__*]` values - different retrieved posts/html.

__The fix:__

Cache post ids. This pull request is best viewed in 800x600 with 16bit color (also, use `?w=1`).