News:

Looking for documentation? Take a look on our wiki

Main Menu

SEVERE Virtuemart 2.0.22a AIO PayPal IPN Bug

Started by marfisk, July 30, 2013, 04:31:59 AM

Previous topic - Next topic

marfisk

I've already fixed it on my site, but it took forever to figure out what had happened. The change in lines 215 and 216 of \plugins\vmpayment\paypal\paypal.php from 20b to 22a will break any site where the Joomla installation is neither the top folder nor the automatic .htaccess redirect. The solution is to find the below part of the code and comment out the bottom line and uncomment out the top line.

To clarify, what it does is as follows:

The old code provided an absolute URL based on the root folder of the Joomla install. This means if the install was in a subfolder, the subfolder name would display in the IPN return URL. The "fix" makes it return to the root folder of the website.

Where the problem occurs is if you have your Joomla/Virtuemart install in a subfolder that is not used as the root folder. Say you have a business home at the top, and your store is in a subfolder called "store".

This code change means the IPN, instead of coming back to the /store subfolder and being processed, goes to the root site, and ends up a 404 because the processing address is not found.

//"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')),
"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')),


Though not relevant to the problem, I'm running

PHP Built On    Linux web01 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.41-2+deb7u2~bpo60+1 x86_64
Database Version    5.1.66-0+squeeze1-log
Database Collation    utf8_general_ci
PHP Version    5.2.17
Web Server    Apache
WebServer to PHP Interface    cgi-fcgi
Joomla! Version    Joomla! 2.5.13 Stable [ Ember ] 24-July-2013 14:00 GMT
Joomla! Platform Version    Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT

Using the JSN Decor template, and the Digitoll downloads plugin.

Assuming this forum will notify me when someone replies, I'm happy to offer more information as necessary in the hopes this will be resolved before the next patch so I can do a simple upgrade.

Thanks,
Margaret