News:

Support the VirtueMart project and become a member

Main Menu

Possible minor bug in PayPal Plugin

Started by WebStuff, July 23, 2013, 15:35:36 PM

Previous topic - Next topic

WebStuff

Just noticed that I was receiving a lot of "file does not exist" errors in my logs for folders components/, media/ and images/ when a customer was checking out with PayPal.
This prompted me to check in my orders and found that the PayPal logo stored with the payment name in the DB was missing my shop subfolder. The bizarre part is that the logo is being displayed as you go through the checkout process it is only at the point of plgVmConfirmedOrder being called it goes wrong.

The offending lines seem to be the return and cancel_return lines around 211 in paypal.php which are setting the path permanently to '' for some reason which means if your joomla is in a subfollder your images disappear.:

"return" => substr(JURI::root(false,''),0,-1) . JROUTE::_( 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt('Itemid')),
and
"cancel_return" =>substr(JURI::root(false,''),0,-1). JROUTE::_( 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt('Itemid')),

As if I replace these with the older lines:
"return"           => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt ('Itemid')),
and "cancel_return"    => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt ('Itemid')),


Then All works as expected.

WebStuff

#1
This bug is still present in the 2.0.22b update.

May want to check the documentation as according to that setting this using this: JURI::root(false,'') is basically resetting the internally stored folder path to be nothing which if your installation is in a sub folder knackers-in all subsequent calls to JURI:: path functions.

WebStuff

This bug is still present in 2.0.24c plugin

alatak

Hello

QuoteMay want to check the documentation as according to that setting this using this:
Code: [Select]
JURI::root(false,'')
is basically resetting the internally stored folder path to be nothing which if your installation is in a sub folder knackers-in all subsequent calls to JURI:: path functions.
Actually you are rigth

this is the code in the url.php

if (isset($path))
{
self::$root['path'] = $path;
}


The problem was how to create an external link  that  works also when virtuemart is in a folder.


alatak

Hello

I am removing the JRoute::_() since it is not necessary in that case.

WebStuff

Quote from: alatak on December 04, 2013, 09:22:57 AM
Hello

I am removing the JRoute::_() since it is not necessary in that case.
Thanks for the response, glad to help. :)

alatak


WebStuff