problem with " require('helper.php') " in mod_virtuemart_category.php

Started by pabloarkotxa, May 03, 2013, 09:43:03 AM

Previous topic - Next topic

pabloarkotxa

When I upload my web, I had problems with " mod_virtuemart_category.php" when called "helper.php" with  "require('helper.php')"
This is the ERROR :

PHP Fatal error: Access to undeclared static property: JLoader::$classes in /hosting/www/maderasarkotxa.es/public/libraries/loader.php on line 195

PHP Fatal error: require(): Cannot redeclare class jmodulehelper in /hosting/www/maderasarkotxa.es/public/modules/mod_virtuemart_category/mod_virtuemart_category.php on line 24.


I had to change require('helper.php') for "require dirname(__FILE__).'/helper.php';" and now works well.
Does anyone know why?
Is this a bug of virtuemart?

PRO

always turn error reporting off on a live server

these messages will never show

jenkinhill

The "Cannot redeclare class jmodulehelper" error seem usually to be related to using a commercial JavaScript rich Joomla template or module, also often if using an older version of T3.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

pabloarkotxa

Quote from: PRO on May 05, 2013, 03:06:48 AM
always turn error reporting off on a live server

these messages will never show
Thanks PRO.

I Know this, but this is not a solution. I have turned off, but the page does not load.

Quote from: jenkinhill on May 05, 2013, 11:03:16 AM
The "Cannot redeclare class jmodulehelper" error seem usually to be related to using a commercial JavaScript rich Joomla template or module, also often if using an older version of T3.

Thanks jenkinhill but I donĀ“t have any comercial moduloe or template in my site. Anyway, when I change require('helper.php') for "require dirname(__FILE__).'/helper.php';" it works well.
I still think it is a bug.
I think, the right thing is to make the call in this way.

Excuse me for my English.