VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: pabloarkotxa on May 03, 2013, 09:43:03 AM

Title: problem with " require('helper.php') " in mod_virtuemart_category.php
Post by: pabloarkotxa on May 03, 2013, 09:43:03 AM
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?
Title: Re: problem with " require('helper.php') " in mod_virtuemart_category.php
Post by: PRO on May 05, 2013, 03:06:48 AM
always turn error reporting off on a live server

these messages will never show
Title: Re: problem with " require('helper.php') " in mod_virtuemart_category.php
Post by: 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.
Title: Re: problem with " require('helper.php') " in mod_virtuemart_category.php
Post by: pabloarkotxa on May 06, 2013, 12:27:51 PM
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.