Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
There is an 'addthis_configuration' alter hook in the addConfigurationOptionsJs() method of the Addthis class. This allows alteration of all the 'addthis_configuration' settings. Currently, the only value you can change in the 'addthis_share' variable is that of 'templates'. There are other things that can be added to the 'addthis_share' variable - namely the url shortener options.
Proposed resolution
Merge alterations from the 'addthis_configuration' hook ($configuration['templates'] and $configuration['addthis_share']) into a variable that will be assigned to the JS variable 'addthis_share'.
Comment | File | Size | Author |
---|---|---|---|
#6 | alter_share_this_variable-1989152-6.patch | 2.01 KB | matglas86 |
Comments
Comment #1
labue CreditAttribution: labue commentedPossible solution
Comment #2
labue CreditAttribution: labue commentedSubmitting new version without meta data
Comment #3
juampynr CreditAttribution: juampynr commentedPatch does not apply. Re-rolling against 7.x-4.x.
More details about patching against a dev branch of a module can be found at http://drupal.org/project/addthis/git-instructions.
Comment #4
matglas86 CreditAttribution: matglas86 commentedNew reroll against head.
Comment #5
matglas86 CreditAttribution: matglas86 commentedHere is some extra info for the api file to give instruction about the use of this alter.
Comment #6
matglas86 CreditAttribution: matglas86 commentedI added some notes to the code. And will commit this.
Comment #8
matglas86 CreditAttribution: matglas86 commented