Module fb_social uses the default cache setting for blocks: DRUPAL_CACHE_PER_ROLE "The block can change depending on the roles the user viewing the page belongs to." So when block is cached, different pages will have the same block content. For example, tag fb:comments includes attribute href that points to current page, so we should never cache block globally like this.
Instead we should use DRUPAL_CACHE_PER_PAGE "The block can change depending on the page being viewed.".
See related API documentation: http://api.drupal.org/api/drupal/modules!block!block.api.php/function/hook_block_info/7
This issue might also be related to http://drupal.org/node/1265224
UPDATE.
Using BLOCK_NO_CACHE is the only way it warranties that the hook page_alter is adding the scripts to the page.
See patch #2
Comment | File | Size | Author |
---|---|---|---|
#1 | fb_social-change-block-caching-1895616-1.patch | 466 bytes | paulihuhtiniemi |
#2 | fb_social-change-block-caching-1895616-2.patch | 460 bytes | corbacho |
Comments
Comment #1
paulihuhtiniemi CreditAttribution: paulihuhtiniemi commentedAnd here's a patch that adds DRUPAL_CACHE_PER_PAGE cache setting for all blocks.
Comment #1.0
paulihuhtiniemi CreditAttribution: paulihuhtiniemi commentedfixed link to API page
Comment #2
corbacho CreditAttribution: corbacho commentedUsing BLOCK_NO_CACHE is the only way it warranties that the hook page_alter is adding the scripts to the page.
Comment #3
ferdi CreditAttribution: ferdi commentedcommitted the patch from here https://drupal.org/node/1265224