VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: lalocva on October 19, 2019, 20:44:51 PM

Title: #0 Call to undefined function vmdebug() ERROR
Post by: lalocva on October 19, 2019, 20:44:51 PM
After updating Joomla to newest version, i updated the Virtuemart component (aio,base, etc). I got a 0 Class 'vmDefines' not found and its imposiblle to enter to administrator page. After updating CUSTOMFIELDSFORALL can get access again to administrator page. but the #0 Call to undefined function vmdebug() ERROR is frontpage. I updated languaje (virtuemart, joomla and other components and i'm stuck with this error)


Call stack
#
Function
Location
1 () JROOT/administrator/components/com_virtuemart/helpers/vmlanguage.php:274
2 vmLanguage::loadJLang() JROOT/administrator/components/com_virtuemart/helpers/config.php:326
3 VmConfig::loadJLang() JROOT/modules/mod_sj_vm_extra_slider/core/vmloader.php:53
4 require_once() JROOT/modules/mod_sj_vm_extra_slider/core/helper.php:13
5 require_once() JROOT/modules/mod_sj_vm_extra_slider/mod_sj_vm_extra_slider.php:17
6 include() JROOT/libraries/src/Helper/ModuleHelper.php:200
7 Joomla\CMS\Helper\ModuleHelper::renderModule() JROOT/components/com_sppagebuilder/addons/module/site.php:48
8 SppagebuilderAddonModule->render() JROOT/components/com_sppagebuilder/parser/addon-parser.php:430
9 AddonParser::getAddonHtmlView() JROOT/components/com_sppagebuilder/parser/addon-parser.php:284
10 AddonParser::viewAddons() JROOT/components/com_sppagebuilder/views/page/tmpl/default.php:94
11 include() JROOT/libraries/src/MVC/View/HtmlView.php:697
12 Joomla\CMS\MVC\View\HtmlView->loadTemplate() JROOT/libraries/src/MVC/View/HtmlView.php:230
13 Joomla\CMS\MVC\View\HtmlView->display() JROOT/components/com_sppagebuilder/views/page/view.html.php:37
14 SppagebuilderViewPage->display() JROOT/libraries/src/MVC/Controller/BaseController.php:672
15 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/components/com_sppagebuilder/controller.php:68
16 SppagebuilderController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:710
17 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/components/com_sppagebuilder/sppagebuilder.php:26
18 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
19 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
20 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:194
21 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:233
22 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:196
23 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49


PHP instalado sobre:
Linux mx60.hostgator.mx 4.14.121-197.ELK.el6.x86_64 #1 SMP Tue May 21 13:24:40 CDT 2019 x86_64
Tipo de base de datos
mysql
Versión de la base de datos
5.6.39-83.1
Cotejamiento de la base de datos
utf8mb4_general_ci
Cotejamiento de la conexión de la base de datos
utf8mb4_general_ci
Versión de PHP
7.1.32
Servidor web
Apache
Interfaz de PHP
cgi-fcgi
Versión de Joomla!
Joomla! 3.9.12 Stable [ Amani ] 24-September-2019 15:00 GMT
Versión de la plataforma de Joomla!
Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
Agente del usuario
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: Nilsy on October 30, 2019, 10:14:40 AM
Same here!
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: GJC Web Design on October 30, 2019, 13:38:11 PM
I assume contact the dev of mod_sj_vm_extra_slider but unclear what is your current error and on what views u see it?

or see here -- the router has just been updated so maybe a re-install update ( I meant that) will help

http://forum.virtuemart.net/index.php?topic=143799.0

Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: Milbo on October 30, 2019, 19:57:44 PM
not reinstall. We always update. The problem is in the 3rd party software not following the mega old advice how to include VM in your code.

But the new router has a kind of compatibility rearrangment. The new router includes the config and is checking if the config was already loaded.
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: Nilsy on October 30, 2019, 22:15:30 PM
I have 2 shops, both updated, but on different servers although same supplier.
One works, one doesn't.

Moved to a different server etc, and it still refused.
On a hunch, I downgraded to VM 3.6.2, and it all started working again.  :)

The "hunch":
In short: I have a test sub-domain on the working server. Since it is a test area, I hadn't upgraded it from the VM 3.6.2 version.
I added some pictures to a product, and all was good.
I then upgraded to the VM 3.6.4, and that's when it collapsed.
It was under the installation of the aio that it went bad.
So, a downgrade fixed that... and then I tested the same thing on the working site. Same thing happened.

I have a working live sub-domain on the same server etc, which IS updated to 3.6.4 and it works fine.
The test site has no 3-party stuff... it is a clean VM installation for testing purposes.
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: Nilsy on October 30, 2019, 23:58:15 PM
Sorry... I have 3.6.2 on the other site too!  :-[
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: EvanGR on November 04, 2019, 09:55:06 AM
I had the same problem, with product pages, after I updated to the latest 3.6.x version... I had to rollback to 3.6.3.

(I also use breakdesigns extensions, not sure if this has anything to do with it)
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: GJC Web Design on November 04, 2019, 09:59:37 AM
the EXACT same error?

Which 3.6.6.xxxx - it matters

Post the trace please
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: EvanGR on November 04, 2019, 10:17:54 AM
Not sure if it was the EXACT same error.

But it was a "call to undefined vmdebug()" in single product pages. I know because I was looking for vmdebug() function calls in my template override, thinking it was my fault.

It must have been version 3.6.6.10187.
Rolled back to 3.6.3 10177 which works fine.


Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: GJC Web Design on November 04, 2019, 10:40:50 AM
com_virtuemart.3.6.6.10191 improves the config loading to try and account for poorly coded 3rd party ext --

Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: EvanGR on November 04, 2019, 10:48:59 AM
Thanks, I will try it, and report back.
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: EvanGR on November 04, 2019, 15:16:38 PM
Same disaster with latest v3.6.6.10191.

Now it's stuck and it's not rolling back to a previous working version... fingers crossed...
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: Nilsy on November 04, 2019, 19:33:22 PM
I tried VM3.6.6.10191 - not working for me.
I tried VM3.6.4.10187 - not working for me.
I tried VM3.6.3.10184 - not working for me.

Rolled back to VM3.6.2.10159, and things work again.

This is the fault list I get when I turn the debug on maximum (see attachment).
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: eliotrayner on November 05, 2019, 18:17:54 PM
J.3.9.12
VM3.6.6.10191

I also had same issue with single product pages. Kept my VM3.6.6.10191 install, but rolled back /components/com_virtuemart/router.php to VM3.6.2.10159 and now working.

Quote from: Milbo on October 30, 2019, 19:57:44 PM
not reinstall. We always update. The problem is in the 3rd party software not following the mega old advice how to include VM in your code.

But the new router has a kind of compatibility rearrangment. The new router includes the config and is checking if the config was already loaded.

Where is the advise re '... old advice how to include VM in your code' ?

thanks
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: Nilsy on November 05, 2019, 19:42:12 PM
Quote from: eliotrayner on November 05, 2019, 18:17:54 PM
J.3.9.12
VM3.6.6.10191

I also had same issue with single product pages. Kept my VM3.6.6.10191 install, but rolled back /components/com_virtuemart/router.php to VM3.6.2.10159 and now working.

Quote from: Milbo on October 30, 2019, 19:57:44 PM
not reinstall. We always update. The problem is in the 3rd party software not following the mega old advice how to include VM in your code.

But the new router has a kind of compatibility rearrangment. The new router includes the config and is checking if the config was already loaded.

Where is the advise re '... old advice how to include VM in your code' ?

thanks

Thank you! That worked for me.
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: hazael on November 05, 2019, 23:18:33 PM
Have you enabled SEO in the VM configuration?
This problem occurs when SEO is inactive.
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: DayCounts 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.
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: eliotrayner 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:

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
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: Dudebaker 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?
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: balai on November 12, 2019, 02:12:28 AM
Guys we will look at that the next days and will provide some feedback.
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: balai 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.
Title: Re: #0 Call to undefined function vmdebug() ERROR
Post by: Milbo on December 16, 2019, 10:47:44 AM
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.