VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: shturmavik on January 26, 2017, 00:23:15 AM

Title: Some error after Update from VM 3.0.18 to 3.0.19
Post by: shturmavik on January 26, 2017, 00:23:15 AM
I have some error after update.
Website https://pegasus-pharma.com
But I was doing all the work on Open Server.
PHP 5.6, Joomla 3.6.5. Multilanguage: En, Lv, Ru

The Error on public:
Fatal error: Call to a member function load() on a non-object in C:\OpenServer\domains\pegasus-pharma-local.ru\administrator\components\com_virtuemart\helpers\vmlanguage.php on line 214

Code:
if($tag!='en-GB' and VmConfig::get('enableEnglish', true) ){
$testpath = $basePath.'/language/en-GB/en-GB.'.$name.'.ini';
if(!file_exists($testpath)){
if($site){
$epath = VMPATH_ROOT;
} else {
$epath = VMPATH_ADMINISTRATOR;
}
} else {
$epath = $path;
}
self::$languages[$tag]->load($name, $epath, 'en-GB', true, false);      //string 214
}


Screenshot:
(http://f5.s.qip.ru/~KhHNrc6n.png) (http://shot.qip.ru/00RUl3-5KhHNrc6n/)
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: Milbo on January 26, 2017, 01:07:03 AM
Thank you. The problem is somewhere before. Did you really install /1046/com_virtuemart.3.0.19_extract_first.zip ?
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: shturmavik on January 26, 2017, 01:48:22 AM
I just installed again but the problem persists.

VirtueMart 3.0.19 Blue Corvus 9430
Joomla! 3.6.5

White page with errors:

Notice: Undefined offset: 0 in C:\OpenServer\domains\pegasus-pharma-local.ru\administrator\components\com_virtuemart\helpers\vmlanguage.php on line 214
Fatal error: Call to a member function load() on a non-object in C:\OpenServer\domains\pegasus-pharma-local.ru\administrator\components\com_virtuemart\helpers\vmlanguage.php on line 214

(http://f3.s.qip.ru/~KhHNrc6o.png) (http://shot.qip.ru/00RUl3-3KhHNrc6o/)

P.S.: pegasus-pharma-local.ru it's Akeeba Backup of pegasus-pharma.com on local web-server
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: Milbo on January 27, 2017, 15:20:03 PM
Please try /1048/com_virtuemart.3.0.19.2_extract_first.zip

But to find the reason, I need a trace, The error just means, that the language got not set. But the question is why. Most time a 3rd party which does not initialise vm correctly.

You may use this extension to get a trace https://www.rupostel.com/utilities-for-joomla/extensions/fatal-catcher-plugin
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: Milbo on January 28, 2017, 13:58:09 PM
/1049/com_virtuemart.3.0.19.2_extract_first.zip

You may try that one. At least when you have the trace, we get the same lines :-)
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: shturmavik on January 28, 2017, 16:43:18 PM
VirtueMart 3.0.19.2 Blue Corvus 9435
Fatal error: Call to a member function load() on null in C:\OpenServer\domains\pegasus-pharma-local.ru\administrator\components\com_virtuemart\helpers\vmlanguage.php on line 214

Maybe I will send you backup of website with error?
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: Milbo on January 28, 2017, 22:11:18 PM
Fatal error: Call to a member function load() on null in C:\OpenServer\domains\pegasus-pharma-local.ru\administrator\components\com_virtuemart\helpers\vmlanguage.php on line 214

This is the symptom, not the reason. The reason is, that the language is not loaded correctly.
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: bma on February 01, 2017, 08:38:10 AM
On upgrade from 3.0.18 to 3.0.19.3 I have this error:

[01-Feb-2017 07:22:36 UTC] PHP Fatal error:  Access to undeclared static property: VmConfig::$jLangCount in E:\xampp\htdocs\mysite\plugins\system\sunfw\includes\overwrite\j3x\components\com_virtuemart\helpers\vmview.php on line 162

I fixed that adding that:
   public static $jLangCount = 1;

on E:\xampp\htdocs\mysite\administrator\components\com_virtuemart\helpers\config.php

Do I made somethings wrong during the upgrade?
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: Milbo on February 01, 2017, 11:10:11 AM
No, it is wrong that your code tries to access this variable there

E:\xampp\htdocs\mysite\plugins\system\sunfw\includes\overwrite\j3x\components\com_virtuemart\helpers\vmview.php on line 162

Very strange path! Looks like a plugin called sunfw is doing strange stuff.

the code in line 136 should be if(VmLanguage::$jLangCount>1 and !empty(VmConfig::$vmlangSef)){

For whatever reason, you have there a quite old vmview.php.
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: bma on February 01, 2017, 11:49:23 AM
Thanks Milbo for your fast answer.

the others things seems works fine... what's your proposal to solve that without my workaround?
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: Milbo on February 01, 2017, 12:48:46 PM
find the VmConfig::$jLangCount

and replace it against

VmLanguage::$jLangCount
Title: Re: Some error after Update from VM 3.0.18 to 3.0.19
Post by: bma on February 01, 2017, 14:11:08 PM
thanks a lot
best regards