If caching of blocks is enabled in Drupal the Facebook Like Button does not show up properly if displayed in a block.

To avoid this we should prevent caching for this block. To do this please insert into function fblikebutton_block_info():

'cache'      => DRUPAL_NO_CACHE,

Comments

lliss’s picture

Is that true? That doesn't make sense to me as the code that would be cached is the iframe code. The guts of it still get loaded from facebook and drupal doesn't really interact with that request at all.

lliss’s picture

Status: Active » Postponed (maintainer needs more info)
jerdiggity’s picture

Assigned: Unassigned » jerdiggity
Status: Postponed (maintainer needs more info) » Active

@smitty: thank you for bringing this up... Complete oversight. Will be included on next dev release.
@lliss: yes. ;)

Thanks again!

j

jerdiggity’s picture

Status: Active » Fixed

Commited to dev snapshot, commit a453b5f.

lliss’s picture

This neither makes sense and I can't reproduce. Can you give a logical reason why it could happen. The iframe code has nothing to do with Drupal. If drupal cached the block it would just be caching some iframe code that would still have to load from facebook. I've regressed the setting for testing and there's no trouble caused by it. @jerdiggity can you reproduce the problem? If not, we're preventing caching, and hurting performance for no reason and I'm inclined to revert the change.

lliss’s picture

Status: Fixed » Needs work
lliss’s picture

Status: Needs work » Closed (fixed)

Thought it out a bit more. I'm fine with this solution.