Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | poll_rollback_0.patch | 1.74 KB | chx |
#3 | poll_rollback.patch | 1.71 KB | chx |
#2 | fix_poll_cache_0.patch | 6.02 KB | merlinofchaos |
fix_poll_cache.patch | 5.93 KB | merlinofchaos | |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commenteda 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.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedIf that's true for poll_vote that's also true for poll_cancel. Updated patch
Comment #3
chx CreditAttribution: chx commentedI 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.
Comment #4
chx CreditAttribution: chx commented:( 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.
Comment #5
Gábor HojtsyCommitted, thanks!
Comment #6
(not verified) CreditAttribution: commented