News:

Support the VirtueMart project and become a member

Main Menu

3.8.6 and 3.8.7 possible bug in helpers/cart.php

Started by CZDave, January 04, 2021, 09:36:46 AM

Previous topic - Next topic

CZDave

Hi,

I'm a developer of ARTIO VM Invoice 3 component. Our clients started to have problems with some functionality after updating VirtueMart to 3.8.6.10373 and 3.8.7.10378 with the following error message:

"Call to a member function set() on null: .../components/com_virtuemart/helpers/cart.php:263"

I've checked the code in that file and it seems that on the mentioned line number 263 there is the following code in function getCart():

$session->set('vmcartlastVendorId', $vendorId, 'vm');

But the $session variable might not be defined - if we pass some data to $cartData argument of the getCart() function, the $session variable will not be initialized. Could you please check this?

Thank you.

Milbo

The  new version has at line 117


$session = JFactory::getSession($options);


That should fix it, or?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

CZDave

Which new version do you mean? I've just checked 3.8.7.10378 and there's the following code:


$multixcart = VmConfig::get('multixcart',0);

if(empty($multixcart)){
    $vendorId = 1;
    //vmdebug('No Multicart vendorId = 1');
} else {
    if($vendorId === NULL){
        $session = JFactory::getSession($options);


So the $session gets initialized there only when multi-vendor cart handling is enabled.

GJC Web Design

I guess Max means to add this at the start of the function

is already fixed in 3.8.7.10380 - soon to be 3.8.8

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

CZDave

Great, thanks, will tell our customers it will be fixed in 3.8.8.

Have a nice day