VirtueMart Forum

VirtueMart 2 + 3 => 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
        (
           
                (
                    [file] => /components/com_virtuemart/router.php
                    [line] => 962
                    [function] => setLanguageByTag
                    [class] => vmLanguage
                    [type] => ::
                    [args] => Array
                        (
                            [file] => /components/com_virtuemart/router.php
                    [line] => 374
                    [function] => getInstance
                    [class] => vmrouterHelper
                    [type] => ::
                    [args] => Array
                        (
                        )

                )

The site uses one language. Any guess with this?
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 :
Code: [Select]
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