VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: chivitli on November 12, 2014, 09:58:26 AM

Title: Fatal error in VM 2.9.9.4 with unpublished products
Post by: chivitli on November 12, 2014, 09:58:26 AM
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.
Title: Re: Fatal error in VM 2.9.9.4 with unpublished products
Post by: Milbo on November 12, 2014, 12:43:36 PM
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.
Title: Re: Fatal error in VM 2.9.9.4 with unpublished products
Post by: chivitli on November 12, 2014, 15:45:34 PM
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
Title: Re: Fatal error in VM 2.9.9.4 with unpublished products
Post by: fenoril on November 23, 2014, 15:47:18 PM
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.
Title: Re: Fatal error in VM 2.9.9.4 with unpublished products
Post by: jenkinhill on November 23, 2014, 16:23:01 PM
You should now be using VM3
Title: Re: Fatal error in VM 2.9.9.4 with unpublished products
Post by: fenoril on November 24, 2014, 09:10:10 AM
I apologize, i forgot plateform :

Joomla 3.3.6, VM 2.9.9.4 on Xampp 1.8.2 php 5.4.31
Title: Re: Fatal error in VM 2.9.9.4 with unpublished products
Post by: Milbo on November 25, 2014, 09:48:45 AM
yeh, the fix is to use the updated version, which is vm3, because vm2.9 is vm3