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.
I have just deployed this button and everything appears to work fine. I can click on it, submit a tweet and see it appear in Twitter.
My problem is with the counter next to the Tweet button. On refreshing the page, it resets to zero.
No errors or warnings. This happens with both the current stable release and the dev release.
Comments
Comment #1
chia CreditAttribution: chia commentedTweet button counter depends on url,
If you access a node by node/{nid} or node path alias, the button counters will be different. As they are considered separate pages by tweet counter.
I use globalredirect to solved this issue.
is this the case?
Comment #2
drupal_acc CreditAttribution: drupal_acc commentedI am not using an alias, but I do notice something odd in how the Tweet Button passes the query portion of the URL to Twitter.
When I click on the count on the Tweet Button, it goes to Twitter to perform a search. I get this:
The link, as used by my site, is:
http://www.mysite.com/?q=node/76
If I do the search manually, using the link as used by my site, then I will find the article.
So, I agree with your statement that Twitter's counter cannot see the pages submitted due to a rewriting of the query string.
How can this be corrected within the Tweet Button module?
I really do not want to be installing additional modules to correct bugs.
Comment #3
drupal_acc CreditAttribution: drupal_acc commentedI had a further look at this:
The full url being passed to Twitter is:
The problem is that the last '/' is encoded as %2F but the '%' is then interpreted as a string and converted to %25
I can trace this in the module code to the attributes:
The above snippet works fine and produces an accurate string in the HTML. The problem comes when you click on the counter to perform a search.
Is there a hook somewhere, or is this something Twitter controls themselves?
Comment #4
drupal_acc CreditAttribution: drupal_acc commentedI have traced through the widget.js file supplied by Twitter. It creates an iFrame for the count to be displayed. The issue seems to be that the URL encoding on this pages mangles Drupal links.
I'm raising the issue with Twitter.
Comment #5
drupal_acc CreditAttribution: drupal_acc commentedIssue raised with Twitter:
http://code.google.com/p/twitter-api/issues/detail?id=2079
Comment #6
mrfelton CreditAttribution: mrfelton commentedsubscribe
Comment #7
drupal_acc CreditAttribution: drupal_acc commentedThis issue was raised Dec. 7th with Twitter. The ticket I created has been merged. Anyone interested in this should star the thread at Google.
http://code.google.com/p/twitter-api/issues/detail?id=2005
Comment #8
esllou CreditAttribution: esllou commentedso with this bug, basically the module doesn't work? The counter would always be showing as 0?
Comment #9
drupal_acc CreditAttribution: drupal_acc commentedGood news, a fix has just been released about an hour ago. I just ran some tests and the counter does appear to be working properly now.
Can anyone else confirm this?
Comment #10
As If CreditAttribution: As If commentedStill not working here. I believe the fix was only partial.
Comment #11
pribeh CreditAttribution: pribeh commentedStill not working here. Should we be trying a newer version of the module?
Comment #12
dlthomas CreditAttribution: dlthomas commentedIt's not working for me either on posts or teasers... ? Running on 7, is there something special I need to do to keep it counting?
Comment #13
dlthomas CreditAttribution: dlthomas commentedUpdate:
Sorry.... cleared browser cache and it's working perfect. Thanks!
Changing back the version to 6.x-1-dev for the other guys....
Comment #14
Thisismeasad CreditAttribution: Thisismeasad commented