Really, really badly.

poll.module loads whether or not you can vote and what you voted on and sticks it on the node in poll_load. However, with cached nodes, that is no longer possible. Instead I had to separate those out and make them separate functions; since fetching the users vote calls a query, I elected to cache this internally. I can no longer cache it on the node because in at least one instance when this is called, I don't have a reference to the node.

I'm not particularly happy with this, but it's the best solution I can think of for the moment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

a quick read looks reasonable.

However, function poll_page() should probably still call cache_clear_all() as well as, since that clears the page and block cache.

merlinofchaos’s picture

FileSize
6.02 KB

If that's true for poll_vote that's also true for poll_cancel. Updated patch

chx’s picture

Title: Node caching patch broke poll.module » Node caching patch broke poll.module -- roll back poll changes
Status: Needs review » Reviewed & tested by the community
FileSize
1.71 KB

I took http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/poll/poll.module?r... and rolled it as a proper Drupal patch so it's definitely RTBC -- it's from the core repo.

chx’s picture

FileSize
1.74 KB

:( I managed to attach a wrong version. Now I checked with diff -up poll.module\?revision\=1.237 modules/poll/poll.module and it's what I expect.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)