When using paypal ec with a localised site that uses language prefixes, the path to the paypal logo is created wrong (with a language prefix), which results in a "not found" logo.

When changing the file modules/ec/commerce_paypal_ec.module line 1561 to:
function commerce_paypal_ec_mark_url() {
return preg_replace(array('|^(.*/)[a-z]+/profiles|','|^(.*/)[a-z]+/sites|'),array('$1profiles','$1sites'),url(drupal_get_path('module', 'commerce_paypal_ec') . '/images/paypal-ec-logo.gif', array('absolute' => TRUE)));
}

The language prefix is stripped out and the logo is loaded correctly.

Comments

joel_osc’s picture

Status: Active » Needs review

I am seeing this issue too, basically on a multilingual site when you call url() you get the language prefix in the path which results in a 404 for the image logo. ie. the path returned looks like www.mysite.com/en/sites/all/modules/contrib/commerce_paypal/module/ec/im... which does not exist. I think the fix should be to just remove the url() function and use the absolute path:

1592 function commerce_paypal_ec_mark_url() {
1593   return drupal_get_path('module', 'commerce_paypal_ec') . '/images/paypal-ec-logo.gif';
1594 }

I tested it and it works for me... if the maintainers think this is the correct fix I can provide a patch.

afagioli’s picture

#1 worked fine to me.
Thanks for sharing with us

joel_osc’s picture

Status: Needs review » Fixed

Noticed the code has been updated to reflect this fix, closing.

Status: Fixed » Closed (fixed)

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