I can't seem to get this module working properly for anonymous users when using block cache (I'm using a module, Form Block, that I use to place a node/add form into a block).

It will on the initial page load but after a refresh, it no longer works even after flushing the cache.

Any ideas on a workaround?

Comments

Steve Dondley’s picture

Just to clarify, with block caching turned off, it works great.

Steve Dondley’s picture

OK, found a work around by using the Block Cache Alter module: http://drupal.org/project/blockcache_alter

sun’s picture

Status: Active » Closed (won't fix)

This cannot be resolved until D7, which has built-in support for the block caching scenario.

doublejosh’s picture

I use Block Cache Alter but still have this problem. What is the workaround?

Thanks!

JvE’s picture

Version: 6.x-1.2 » 7.x-1.x-dev
Status: Closed (won't fix) » Active
Rob_Feature’s picture

I'm not sure if it's block cache or not, but I'm seeing this behavior with Varnish caching. I'd like to try this solution by altering block cache to see if it helps...can someone explain what needs to be done, please?

kris_mcl’s picture

I'm also having problems with Compact Forms & block cache in Drupal 7.17 with compact_forms 7.x-1.0. compact_forms.js generally doesn't load with block cache turned on, though it sometimes works immediately after clearing the site cache or running cron.
I'd also love to see a fix for this or an explanation of how to use the Block Cache Alter.

Thanks!

oriol masjuan’s picture

Basically the problem is that when the block is cached drupal does'nt call any more the hook_form_alter (of the compact form) that adds a class to the block.

A reasonable solution is to create a module that disables the cache for that specific module.

Here is teh code
/**
* Implements hook_block_info_alter().
*/
function YOURMODULENAME_block_info_alter(&$blocks, $theme, $code_blocks) {
$blocks['mailchimp_lists']['newsletter']['cache'] = DRUPAL_NO_CACHE;
}

fox mulder’s picture

Issue summary: View changes

Thank You omasjuan, Your solution works great!

(
where the error occured:
Compact Forms 7.x-1.0
Drupal 7.26
Block cache switched On
)

G2’s picture

An addition for omasjuan solution: you should always check if the block exists in block info alter, if you disable the module later or delete the block it will throw an error which is really hard to debug (run into this issue)

/**
* Implements hook_block_info_alter().
*/
function YOURMODULENAME_block_info_alter(&$blocks, $theme, $code_blocks) {
  if (isset(['mailchimp_lists']['newsletter'])) {
    $blocks['mailchimp_lists']['newsletter']['cache'] = DRUPAL_NO_CACHE;
  }
}