diff -urp --strip-trailing-cr ../drupal-6.x-dev/modules/poll/poll.install ./modules/poll/poll.install --- ../drupal-6.x-dev/modules/poll/poll.install 2009-01-06 16:46:37.000000000 +0100 +++ ./modules/poll/poll.install 2009-07-18 22:29:37.000000000 +0200 @@ -130,3 +130,21 @@ function poll_schema() { return $schema; } +/** + * @defgroup updates-6.x-extra Extra poll updates for 6.x + * @{ + */ + +/** + * Fix cache mode for "Most recent poll" block. + */ +function poll_update_6000() { + $ret = array(); + $ret[] = update_sql("UPDATE {blocks} SET cache = 2 WHERE module = 'poll' AND delta = '0'"); + return $ret; +} + +/** + * @} End of "defgroup updates-6.x-extra" + * The next series of updates should start at 7000. + */ diff -urp --strip-trailing-cr ../drupal-6.x-dev/modules/poll/poll.module ./modules/poll/poll.module --- ../drupal-6.x-dev/modules/poll/poll.module 2008-12-18 16:46:20.000000000 +0100 +++ ./modules/poll/poll.module 2009-07-18 21:45:53.000000000 +0200 @@ -131,6 +131,7 @@ function poll_block($op = 'list', $delta if (user_access('access content')) { if ($op == 'list') { $blocks[0]['info'] = t('Most recent poll'); + $blocks[0]['cache'] = BLOCK_CACHE_PER_USER; return $blocks; } else if ($op == 'view') { @@ -776,6 +777,8 @@ function poll_cancel($form, &$form_state // Subtract from the votes. db_query("UPDATE {poll_choices} SET chvotes = chvotes - 1 WHERE nid = %d AND chorder = %d", $node->nid, $node->vote); + + cache_clear_all(); } /**