Posted by fl3a on October 15, 2008 at 10:03am
| Project: | AddThis |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | wesku |
| Status: | needs review |
Issue Summary
Hi, i have the following problem with addthis, tested on 2 different 5.x-sites:
This is the result of sharing via mail:
--
addthis test
/node/1069?Array
[Message sent by foo@bar.com via AddThis]
--
And this is the url when i try to submit to myspace:
--
http:///node/1069?Array
--
Comments
#1
I have the same problem. I have outcommented:
/* addthis_offset_top = \'%d\';
addthis_offset_left = \'%d\'; */
But that should not have an effect. Any solution?
#2
This has now been fixed in 2.1 version for D5.x.
#3
Automatically closed -- issue fixed for two weeks with no activity.
#4
No it has not been fixed, I am using 2.1 with drupal 5.x and I am still getting the same problems as explained above.
#5
Then it is a new issue. This issue was originally related to offset handling and that has now been disabled. Please provide more information about the issue. Does this happen always? In every page? With all browsers?
#6
I second this, it happens in FF3 and IE6 when the button is set to appear in the teaser. When it's on the full node view the url is sent fine. When is on the teaser only the http://node_name/ is sent to the bookmarking services.
Please take a look here: http://muaythai.sg/
Using the 5.x-2.1 version.
Thank you.
#7
I'm experiencing this also on several web sites. I can confirm that it works fine on the full node, but not the teaser.
#8
Any news? Thanks.
#9
still an issue with the teaser, but works so far as I see it, with the full node post...
#10
This looks like something that has been addressed in the 6.x version but was never backported ... on line 221 the URL is added using
url('node/'.$node->nid). We need to specifically tell url() to generate this as an absolute URL (ie, including the domain) rather than relative to the base path.In Drupal 6 this is done with a settings array, but in D5 we need to add a series of defaulted variables between the URL and the 'absolute' parameter. The line becomes:
<?php$teaser ? url('node/'. $node->nid, NULL, NULL, TRUE) : '[URL]',
?>
Find attached a patch to apply this to the current 5.x-2.1 build.
#11
Ha ha! I just ran into this again and look, here's my fix from the last time. How handy. Thanks, past me!
#12
I think we need a new 5.x branch maintainer for the module. Sorry about this taking a loooooong time. I am trying to clean up the issue queue and get back to 5.x issues also.
#13
This is a possible fix. I tried this on function addthis_link(). My version is D6.
It worked here.
/**
* Implementation of hook_link().
*/
function addthis_link($type, $node = NULL, $teaser = FALSE) {
...
$addthis_widget_type = variable_get('addthis_widget_type', 'addthis_button');
$query = explode('&', $_SERVER['QUERY_STRING']);
$urlParams = array();
foreach($query as $param) {
list($name, $value) = explode('=', $param);
if($name != 'q'){
$urlParameters .= '&'.($name).'='.($value);
}
}
$links = array();
$links['addthis'] = array(
'title' => theme($addthis_widget_type, NULL, array(
'url' => url('node/' . $node->nid, array('absolute' => TRUE, 'query' => $urlParameters )),
'title' => $node->title,
)),
'html' => TRUE,
);
return $links;
}