Closed (fixed)
Project:
ShareThis
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Sep 2012 at 21:53 UTC
Updated:
7 Nov 2013 at 05:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Lythimus commentedThanks. I was receiving this error when using colorbox_node.module and this patch appears to have resolved it. I recommend pushing into dev branch.
Comment #2
Chaulky commentedYou really just need to use drupal_add_js instead of writing out the script tag. Drupal will not duplicate external JS files added using drupal_add_js.
Comment #3
steven.wichers commentedHere's a patch that uses drupal_add_js() instead of
tags for the ShareThis service. It does not convert the configuration screen to use #attached instead of inlining javascript inside a div.Comment #4
steven.wichers commentedComment #6
steven.wichers commentedI just checked out the 2.x-dev branch and the code is too different to apply the patch to. The patch I provided will apply cleanly to the 2.5 release, but is not useful for continued development. I made a patch for the dev branch (that includes using #attached for the form related javascript), but because the dev branch uses theme() for including the javascript and ShareThis elements it is open to caching problems. drupal_add_js() will not include the javascript when serving up a cached tpl. The proper way to do this is to use a render array with the #attached attribute including the necessary scripts. Doing it in this manner will ensure Drupal only includes scripts once, and they get included even if the theme output gets cached.
Comment #7
Gaofengzzz commentedcreate patch for this issue.
Comment #8
Gaofengzzz commentedThis patch is commited in d521c49.
Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on any aspects in the commits or this ticket in general, I would be glad to provide more information or explain in more details.
Cheers!