related products show first instead of at bottom of article
Chad_Dupuis - August 19, 2007 - 18:17
| Project: | Amazon associate tools |
| Version: | 5.x-1.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
I'm hoping this is just a configuration issue that I'm missing, but I'm working through the upgrade from 4.7 to 5.x and have many related product links. Since I've upgraded to 5.x and the latest amazon module all of my related books show at the top of the article instead of at the bottom.
I'm not sure if this is a bug, a weighting issue (although i don't know where to set that), or something else.
Any help would be appreciated.

#1
I've also recreated this issue on a clean 5.x install to eliminate the possibility that the upgrade would have caused this behavior. Any help would be appreciated....
#2
I have the same issue. I tried changing the weight of the module to 5, no good.
#3
I fixed it.
I added a weight to the related links array in the amazon nodeapi hook.
{if ($node->in_preview == 1) {
$amazondata = _amazon_product_data_from_Amazon($form_values['asin']);
}
else {
$amazondata = $node->amazonnode_data;
}
if ($amazondata) {
foreach($amazondata as $amazon_data) {
$related_links .= theme('amazon_related_link', $amazon_data);
}
$node->content['related_links'] = array(
'#weight' => 25, //Added this line
'#value' => $related_links
);
}
}
If I have some time tomorrow I will try and create a patch ... but if you are faster .. by all means go for it.
#4
Ooops left out some code ...
case 'view': {if ($node->in_preview == 1) {
$amazondata = _amazon_product_data_from_Amazon($form_values['asin']);
}
else {
$amazondata = $node->amazonnode_data;
}
if ($amazondata) {
foreach($amazondata as $amazon_data) {
$related_links .= theme('amazon_related_link', $amazon_data);
}
$node->content['related_links'] = array(
'#weight' => 25, //Added this line
'#value' => $related_links
);
}
}
#5
Thank you ambereyes -- works like a charm and I would have never found that! I had also tried changing the weight in the system table for amazon.module to no avail - I'm not sure why that wouldn't work... Oh well!
#6
I've attached the patch that fixes this issue, hopefully this can get rolled in to a release. Accordingly, I've marked the priority critical and moved it to bug reports....
#7
Patch seems to work well - is there any chance of getting this committed to a full release?
#8
+1 Works for me
#9
Just another reminder of the real power of Drupal - it's the support from the community. I thank the module creator, as well as the user (s) who raised the issue. I was faced with the same situation where the related content was showing up at the top and I couldn't figure out a way to fix it -so here I come and found the solution. Thank you.
#10
Hi, I am not creating a separate issue as this seems related to the original issue here: The patch seems to work, although initially it was working only for certain user roles - I enabled 'search amazon' for all roles, and then it seems to work for anonymous users as well, though I don't understand the connection. But here is one thing I would still like fixed, if possible:
On the teaser, the related products show up along with the text, on the front page. I have the 'excerpt' module and often use custom teasers, but there is no way to get rid of the amazon related products from showing up in the teasers - any suggestions, or anything I am overlooking? I am still a relative newbie, BTW, and I'm playing with my Linux sandbox.
#11
I found the 'Retease' module, installed it and rebuilt the teasers - so now the amazon related products do not show up on the teasers anymore.
#12
Automatically closed -- issue fixed for two weeks with no activity.
#13
This issue was prematurely closed due to Ramper mistakenly changing the status.
Has this patch been included in the current release?
#14
Oh and he also changed the issue. Arrgh!
#15
The patch has been included in my release. How this will be handled is upto the drupal staff and the original author. I would love to just post the new moduel!
#16
*subscribe*
#17
fixed, should be in Dev
#18
marked as fixed
temp
Automatically closed -- issue fixed for two weeks with no activity.
temp
Automatically closed -- issue fixed for two weeks with no activity.
#19
Automatically closed -- issue fixed for two weeks with no activity.