The path to the image modules/amazon_store/images/shopping_cart.png breaks in the sidebar when the page you are viewing is not relative to root. (such as in an image gallery)

here is the source created on my installations;
Only local images are allowed.

I believe it should be /modules/amazon_store/images/shopping_cart.png. (add the first slash)

amazon_store\amazon_store_search_block.tpl.php (line 11) reads;
img src=" print "$directory/images/shopping_cart.png" "

Comments

rfay’s picture

I can confirm this bug. I'll definitely visit it for the next round of changes. Thanks for the report.

rfay’s picture

Status: Active » Fixed

OK, I think I finally got this. It's fixed in the next release.

iva2k’s picture

Status: Fixed » Active

I am reopening this bug, since there seems to be quite a few images like that remaining, which are still in the 6.x-1.x-dev latest code.

iva2k’s picture

It looks like $directory ends up to be a relative path which browser interprets relative to /amazon_store path which is incorrect. I believe the code should be

<?php
print "$base_url/$directory/images/shopping_cart.png" 
?>
iva2k’s picture

Version: 6.x-1.0-beta3 »
Status: Active » Needs review
StatusFileSize
new6.03 KB

Patch attached. It fixes images for me.

Please review for committing to 6.x.-1.x-dev.

iva2k’s picture

StatusFileSize
new5.77 KB

Sorry, got some leftover files when rolling the patch. Here's a cleaner patch.

Please review for committing to 6.x.-1.x-dev.

iva2k’s picture

StatusFileSize
new6.24 KB

Missed one more use of $directory. Patch #3.

Please review for committing to 6.x.-1.x-dev.

rfay’s picture

Status: Needs review » Fixed

iva2k, thanks for your effort on this, but I'm pretty sure it's out of date.

per the excellent suggestion of someone in IRC, I worked at this by using theme_image(). I'm not sure what your patch is against, but it doesn't look like the code that was fixed with theme_image.

Everywhere that I could find, I changed the code to, for example:

print theme('image',"$directory/images/no_image_small.jpg");

which I think is the best solution.

If you want to take a look at the CVS code and see if there are things that I missed, or check it when I get a release out, your involvement is very welcome.

Thanks,
-Randy

iva2k’s picture

I rolled the above patch against latest 6.x-1.x-dev. It should not be more than 12 hours behind, unless you are working in unpublished branch. But wait - I just noticed you removed -dev from the project page. I will not use that as a base anymore.

rfay’s picture

Status: Fixed » Postponed (maintainer needs more info)

When I get this next release out, please let me know if you see any more issues with images. I'll take another look before releasing, too.

Thanks again for your involvement.

-Randy

rfay’s picture

I did in fact find lots more places that were not handled correctly, so I'll appreciate it if you can look this over carefully in 6.x-2.0-alpha1, which should be out shortly.

rfay’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

iva2k’s picture

I verified it OK - no more image path problems.