News:

Looking for documentation? Take a look on our wiki

Main Menu

#0 Call to undefined function vmdebug() ERROR

Started by lalocva, October 19, 2019, 20:44:51 PM

Previous topic - Next topic

hazael

Have you enabled SEO in the VM configuration?
This problem occurs when SEO is inactive.

DayCounts

I confirm. BeakDesign custom field for all breaks the product detail page.
Disabling the system plugin "Base Custom Fields for All" fixes the issue. However if you have some custom field for all fields they will not load properly.

eliotrayner

#17
I just updated to VM3.6.8.10197 and site is working apart from single product pages. I get the following error:

QuoteCall to undefined function vmdebug() in file: administrator\components\com_virtuemart\helpers\vmlanguage.php line: 274

As @DayCounts points out Disabling the system plugin "Base Custom Fields for All" fixes the issue. However if you have some custom field for all fields they will not load properly.

The error is in plugins\system\customfieldsforallbase\bootstrap.php, which needs VmConfig::loadConfig();

The following fixes the issue for me. Change ~ lines 3-10 ...

Quote
if (! class_exists('\vmDefines')) {
    require_once (JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'config.php');
    //Virtuemart changes the file structure in 3.4.3 for vmDefines
    if (! class_exists('\vmDefines')) {
        require_once (JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'vmdefines.php');
    }
    \vmDefines::defines();
}

to

Quote
if (! class_exists('\vmDefines')) {
    require_once (JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'config.php');
   VmConfig::loadConfig();
    //Virtuemart changes the file structure in 3.4.3 for vmDefines
    if (! class_exists('\vmDefines')) {
        require_once (JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'vmdefines.php');
    }
    \vmDefines::defines();
}

This change does not work prior to VM3.6.x

Dudebaker

#18
Through this fix the error message disappears and the shop works again but the multilanguage-support is then broken.
For example the text "Sort by Ordering" or "Add to cart" will stay at the default shop language.

Debug with this workaround:
1 vmdebug 5 Languages, default shoplanguage (VmConfig::$jDefLang): de_de de-DE Selected VM language (VmConfig::$vmlang): de_de de-DE SEF: de $lfbs =

Debug with disabled plugin:
1 vmdebug 5 Languages, default shoplanguage (VmConfig::$jDefLang): de_de de-DE Fallback language (VmConfig::$defaultLang): de_de Selected VM language (VmConfig::$vmlang): en_gb en-GB SEF: en $lfbs =

As we can see, the selected vm language (en_gb) is not listed and vm uses the default language (de_de).

I didn't find an other way to fix this - we will have to wait for breakdesigns to fix this or maybe someone else has a hint?

balai

Guys we will look at that the next days and will provide some feedback.

balai

#20
Update:
A new version of Custom Fields For All is released with a fix included (v. 4.0.5).
Anyone using VM 3.6.8 and higher is urged to update his version.

Milbo

Could you please check if the problem appears with this router instance code? router.php


public static function getInstance(&$query = null) {

static $lConf = true;
if($lConf){
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);
}

$lConf = false;
}


This code should prevent the problem. The cause for the issue is including the vmconfig but not loading it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/