Author Topic: #0 Call to undefined function vmdebug() ERROR  (Read 11923 times)

hazael

  • Jr. Member
  • **
  • Posts: 309
    • Biżuteria etniczna orientalna arabska
  • VirtueMart Version: VM 4.0.12 [J3][J4]
Re: #0 Call to undefined function vmdebug() ERROR
« Reply #15 on: November 05, 2019, 23:18:33 pm »
Have you enabled SEO in the VM configuration?
This problem occurs when SEO is inactive.

DayCounts

  • Beginner
  • *
  • Posts: 24
  • DayCounts.com, your Virtuemart expert
    • DayCounts.com
Re: #0 Call to undefined function vmdebug() ERROR
« Reply #16 on: November 05, 2019, 23:45:29 pm »
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

  • Beginner
  • *
  • Posts: 13
  • VirtueMart Version: VM3.6.8
Re: #0 Call to undefined function vmdebug() ERROR
« Reply #17 on: November 07, 2019, 13:09:33 pm »
I just updated to VM3.6.8.10197 and site is working apart from single product pages. I get the following error:

Quote
Call 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

  • Beginner
  • *
  • Posts: 10
Re: #0 Call to undefined function vmdebug() ERROR
« Reply #18 on: November 11, 2019, 16:44:08 pm »
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

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1511
Re: #0 Call to undefined function vmdebug() ERROR
« Reply #19 on: November 12, 2019, 02:12:28 am »
Guys we will look at that the next days and will provide some feedback.

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1511
Re: #0 Call to undefined function vmdebug() ERROR
« Reply #20 on: November 18, 2019, 14:09:20 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10545
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: #0 Call to undefined function vmdebug() ERROR
« Reply #21 on: December 16, 2019, 10:47:44 am »
Could you please check if the problem appears with this router instance code? router.php

Code: [Select]
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/