Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Cannot redeclare class JModuleHelper with certain Template

Cannot redeclare class JModuleHelper with certain Template

Thank you so much for such a great Module/Plugin. It has helped me so much in the past. My question/problem stems from installing the MetaMod Pro on my Joomla 3.4.0/Virtuemart 3.0.6.2 with a Template (http://www.virtueplanet.com/vp-merchant-detail) by Virtueplanet.com.

I've tested the module on Protostar, and everything works fine, so I know there is a conflict somewhere with the template. I've sent an email to Virtueplanet, and they responded with "MetaMod Pro does not seem to be a core Joomla extension. It must be trying to override core Joomla system class "JModuleHelper" which is generating the error."
I read another post on your forum about switching the  plugin order but I'm just scared that I might mess something else up that was working.
Any suggestions?
J

jdsilva
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Cannot redeclare class JModuleHelper with certain Template

Yes, the template people are correct, MetaMod Pro has to override the module helper class in order to do its magic. Despite a number of approaches to the Joomla core team, they have never agreed to make the changes necessary for MetaMod (and other similar systems) to operate.

A few of us including NoNumber.nl (Peter van Westen) and Joomlart discussed together a joint change that we could all make that can override that class and provide the required functionality by means of a set of plugin points. Because of this joint venture, people can use any of our products together without clashing, because the extra magic is done in plugins by way of an agreed API. I wish that more extension developers would join us and prevent clashes as each developer adds some of their own functionality to the class and overrides it.

Do you have any idea if it is the Virtueplanet template or indeed Virtuemart that is the other extension overriding JModuleHelper? Or perhaps it’s a different extension entirely?

It can take a little bit of exploring to find which other extension it is that’s doing it. Usually I grep through the source code of the entire site for the text “JModuleHelper” and that comes up with something. If you can do that and let me know what extension it is, then that will go some way to finding a work-around. The last time I did this I found it was a plugin that wasn’t even needed on the site, so it was easy to turn it off and problem solved. If on the other hand it’s the template itself, then it might be more difficult, but let’s cross that bridge when we come to it. Perhaps could you e-mail me a copy of the template installation package?

Please let me know how you get on.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: Cannot redeclare class JModuleHelper with certain Template

Hello Stephen, thank you very much for your reply to my issue. I asked Jumbo from the virtueplanet.com team regarding their VM3 template about the JModuleHelper class, and his reply was the following:

USER wrote:

The template does not override JModuleHelper. It uses the core Joomla class. Your 3rd party extension is trying to override the class even when the core class is already loaded so it generates standard PHP error.
They need to check the class existence with class_exists() (ref: php.net/manual/en/function.class-exists.php) function before loading their custom class.

I also went into the backend and uninstalled a previous template and some other modules I wasn't using for the system. I still get the error:
Fatal error: Cannot redeclare class JModuleHelper in /home/beyond/public_html/j3vm3/libraries/cms/module/helper.php on line 20

I also grep -r "JModuleHelper" on the local copy of the files and found many listings . How can I send you the output of what I found? I don't know where to look and what to look for. I can also send you the install package for the virtueplanet template when you send me your email. Thank you so much for your help.

jdsilva
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Cannot redeclare class JModuleHelper with certain Template

Before I forget, I also read somewhere that the re-ordering of the plugins can make a difference.

jdsilva
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Cannot redeclare class JModuleHelper with certain Template

Good news: this issue with VirtuePlanet templates is fixed in MetaMod Pro v3.24 which you can download from your account.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1696
Total Polls:
6
Total Posts:
5941
Posts this week:
7
User Info:
 
Total Users:
5418
Newest User:
outsd2
Members Online:
0
Guests Online:
92

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked