Fatal error in VM 2.9.9.4 with unpublished products

Started by chivitli, November 12, 2014, 09:58:26 AM

Previous topic - Next topic

chivitli

In VM 2.9.9.3 and 2.9.9.4 (2.9.9.2 was fine) there has been a change in /product.php so any time there is an unpublished product I get

Fatal error: __clone method called on non-object in .../administrator/components/com_virtuemart/models/product.php on line 762.

On line 775 I changed

self::$_products[$productKey] = FALSE;

to

unset(self::$_products[$productKey]);

since otherwise line 775 evaluated to true even if there was no object for that key. Another solution would be to make an additional check on line 762.

Milbo

Do you mean, if you use an unpublished product as pattern? It helps extremly if you know a similar case to reproduce within the sample data. Then I could just open the right product and get the error.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

chivitli

I was working on a clients' site, so unfortunately I cannot reproduce it from zero. Some edge case does seem to exist, so it might be best to use is_object before cloning

fenoril

Hello !

I've had the same message, here's the configuration. I wish it can help but my shop is translated in french so... I'm not sure of my re-translations in english :

I've toggle the "don't show product" option in stock management setup in "front market" and had the message on the glogal shop page. With any other option i haven't.
The shop is just configured "from the box", with demonstration products. So i've trought to set a stock number for some products but it didn't work better. Now i'm going to delete all demo product and try with my ones. I'll tell you if the shop works differently.

I use VM 2.9.9.4 and Joomla 3.3.6

Thanks you all for spending time on our problems.
Virtuemart 2.9.9.4, Joomla 3.3.6, Xampp 1.8.2, Php .5.4.31

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

fenoril

I apologize, i forgot plateform :

Joomla 3.3.6, VM 2.9.9.4 on Xampp 1.8.2 php 5.4.31
Virtuemart 2.9.9.4, Joomla 3.3.6, Xampp 1.8.2, Php .5.4.31

Milbo

yeh, the fix is to use the updated version, which is vm3, because vm2.9 is vm3
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/