VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: sandomatyas on May 10, 2021, 14:11:13 PM

Title: Call to undefined function vmdebug() in vmlanguage.php
Post by: sandomatyas on May 10, 2021, 14:11:13 PM
When I open a product page with SEF url, I got this:
Error Object
(
    [message:protected] => Call to undefined function vmdebug()
    [string:Error:private] =>
    [code:protected] => 0
    [file:protected] => /administrator/components/com_virtuemart/helpers/vmlanguage.php
    [line:protected] => 113
    [trace:Error:private] => Array
        (
           
Title: Re: Call to undefined function vmdebug() in vmlanguage.php
Post by: sandomatyas on May 11, 2021, 09:47:17 AM
I digged a bit and found components/com_virtuemart/router.php
public static function getInstance(&$query = null)


There is this if :
if (!class_exists( 'VmConfig' ) or !class_exists('VmLanguage') or !isset(VmLanguage::$currLangTag)) {
if (!class_exists( 'VmConfig' )){
require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
}

VmConfig::loadConfig(FALSE,FALSE,true,false);    // this is needed in case VmConfig was not yet loaded before
//vmdebug('Router Instance, loaded current Lang Tag in config ',VmLanguage::$currLangTag, VmConfig::$vmlang);
}

But somehow this code part never runs in this site when I try to open a productdetails page or search result.
If I add a simple 'true or' or remove the conditions the site is working well.
It happens only on this site maybe some different config? I don't know