VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: atrus on February 15, 2013, 13:19:47 PM

Title: [solved]2.0.18b Internal Server Error 500
Post by: atrus on February 15, 2013, 13:19:47 PM
hi to all,

after installing 2.018b, our site went down and at the home page we got:

'Internal Server Error 500'

Checked the error log file and saw the following:

[15-Feb-2013 12:13:16 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/qualityb/public_html/plugins/vmcustom/stockable/stockable.php on line 229
[15-Feb-2013 12:14:15 UTC] PHP Fatal error:  Cannot access private property calculationHelper::$_cats in /home/qualityb/public_html/administrator/components/com_virtuemart/models/customfields.php on line 841
[15-Feb-2013 12:14:37 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/qualityb/public_html/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 104

I guess the Fatal error above is the problem; would appreciate your advice. Fow now we have switched back to 2.0.18a and the site works ok.

Rgrds,
Chris
Title: Re: 2.0.18b Internal Server Error 500
Post by: Milbo on February 17, 2013, 18:51:36 PM
This a very strange error, seems like the update was only partly implemented. Because it was before a private attribute and is is now public.
Title: Re: 2.0.18b Internal Server Error 500
Post by: atrus on February 17, 2013, 19:14:42 PM
Thanks for your reply Milbo; tested the version you uploaded today and the problem happened again. Is there any VM file i can check for this attribute?

Rgrds,
Chris
Title: Re: 2.0.18b Internal Server Error 500
Post by: Milbo on February 18, 2013, 19:20:38 PM
You could upload the files per ftp directly. the structure in the installer is the same as on the server.
Title: Re: 2.0.18b Internal Server Error 500
Post by: atrus on February 19, 2013, 07:58:21 AM
Did a full ftp copy of the 2.0.18b files - all transfered succesfully - however the same Fatal error appeared and the site is broken, returned back to 2.0.18a. Maybe i should check a specific VM2 file? Do you have an idea?
Title: Re: 2.0.18b Internal Server Error 500
Post by: Milbo on February 20, 2013, 01:29:39 AM
you can check the line in calculationh.php and check if the $_cats is using var
Title: Re: 2.0.18b Internal Server Error 500
Post by: atrus on February 20, 2013, 08:37:38 AM
Thanks; checked calculationh.php and i can see:

var $_cats;

So i guess no problem there?

For now, i have disabled the following line 841 from customfields.php and the site is working again:

$calculator->_cats = $product->categories;

Maybe there is some problem with above line? This line was added in 2.0.18b and maybe it is causing the problem. Is the code correct?

UPDATE: Things get weirder: after adding a few products to the cart we got another FATAL error and the site broken again:

[20-Feb-2013 08:04:41 UTC] PHP Fatal error:  Cannot access private property calculationHelper::$_cartData in /home/qualityb/public_html/administrator/components/com_virtuemart/plugins/vmpsplugin.php on line 952

I checked again calculationh.php and saw:

var $_cartData; (that was private also before)

Line 952 in vmpsplugin is the following:

if(!empty($calculator->_cartData['VatTax']) and count ($calculator->_cartData['VatTax']) == 1){

this is also new in 2.0.18b

FYI, we are using PHP 5.3.17. We'd appreciate your assistance!

Thanks,
Chris
Title: Re: 2.0.18b Internal Server Error 500
Post by: Milbo on February 20, 2013, 11:12:31 AM
Maybe it is some strange caching on your server. It looks like it uses the old calculationh.php
Title: Re: 2.0.18b Internal Server Error 500
Post by: atrus on February 21, 2013, 14:38:18 PM
Thanks for the hint Milbo, it was finally a 3rd party plugin that needs to be updated (Chameleon)

Rgrds,
Chris