Klarna plugin breaks after updating from Joomla 2.5.20 to 2.5.22

Started by SteveTM, June 13, 2014, 11:50:51 AM

Previous topic - Next topic

SteveTM

After updating Joomla from 2.5.20 to 2.5.22, the Klarna Payment plugin in breaks and generates error.

When I trying to access the plugin from the backend administration, the layout is broken and

Warning: require(/home/u/u8823798/www/plugins/vmpayment/klarna/helpers/define.php) [function.require]: failed to open stream: No such file or directory in /home/u/u8823798/www/plugins/vmpayment/klarna/klarna/elements/getklarna.php on line 25

It seems that Klarna gets a wrong path as the helpers folder is located in klarna/klarna/helpers and not klarna/helpers

Following code in getklarna.php constructs the path

if (JVM_VERSION === 2) {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'klarna' . DS . 'helpers' . DS . 'define.php');
if (!class_exists ('KlarnaHandler')) {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'klarna' . DS . 'helpers' . DS . 'klarnahandler.php');
}
} else {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'helpers' . DS . 'define.php');
if (!class_exists ('KlarnaHandler')) {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'helpers' . DS . 'klarnahandler.php');
}
}


Joomla 2.5.22
Virtuemart 2.6.6
PhP: 5.3.27

Grateful for assistance as I had to revert to 2.5.20 and can not update until this is solved

Regards/Stefan

alatak

Hello

Can you try replacing this  code
if (JVM_VERSION === 2) {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'klarna' . DS . 'helpers' . DS . 'define.php');
if (!class_exists ('KlarnaHandler')) {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'klarna' . DS . 'helpers' . DS . 'klarnahandler.php');
}
} else {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'helpers' . DS . 'define.php');
if (!class_exists ('KlarnaHandler')) {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'helpers' . DS . 'klarnahandler.php');
}
}


by

require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'klarna' . DS . 'helpers' . DS . 'define.php');
if (!class_exists ('KlarnaHandler')) {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'klarna' . DS . 'helpers' . DS . 'klarnahandler.php');


SteveTM

Hi

I will replace it on a testsite, and get back with the result.


Regards/Stefan

SteveTM

Hi

After replacing the code, I get following error, trying to open the plugin:


Parse error: syntax error, unexpected $end in /home/u/u8823798/www/plugins/vmpayment/klarna/klarna/elements/getklarna.php on line 58

Regards/Stefan

alatak

Hello
ok, sry missing one line
This should be correct:
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'klarna' . DS . 'helpers' . DS . 'define.php');
if (!class_exists ('KlarnaHandler')) {
require (JPATH_ROOT . DS . 'plugins' . DS . 'vmpayment' . DS . 'klarna' . DS . 'klarna' . DS . 'helpers' . DS . 'klarnahandler.php');
}

SteveTM

Hi

yes that works and the plugin shows correctly,
but language files don't seem to load and all old values are gone (see attachment).

Regards/Stefan

[attachment cleanup by admin]

alatak


SteveTM

Hi

Yes VM 2.6.6 and Joomla 2.5.20

PHP 5.3.27

Regards/Stefan