There are cases in which hook_block ($op == 'view') can be called more than once per pageload. The Fusion theme, for instance, causes this in its implementation of theme_preprocess_block. When this happens the javascript in theme_addthis_button doesn't get properly attached (it thinks it's already been attached).

Anyhow, I've attached a patch that uses drupal_set_html_head() to attach the javascript to the page which fixes the problem.

The patch was based off the current 6.x-2.x-dev

CommentFileSizeAuthor
#1 addthis_inline_script.patch1.41 KBaaron
addthis.patch1015 bytesazinck
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aaron’s picture

FileSize
1.41 KB

this patch does the same, but puts it inline in the footer as does google analytics. not sure which is better; i'd done this up before i searched the issue queue, sorry :P

gisle’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

This bug report is 4 years old and is about an outdated version of the module.

Please open a new issue with a re-rolled patch if you think this bug report is still relevant for AddThis 7.x-4.x.