Our blog

 

Magento Module Not Working? This Might be Why

After a few hours of intense googling I have finally figured out why my Magento custom module is refusing to activate. I finally figured it out. It's all because the snippet of XML that I copied and pasted off a tutorial somewhere did not have the right capitalisation.

doesn't work - EC_All.xml

XML:
  1. <?xml version="1.0"?>
  2. <config>
  3.     <modules>
  4.         <EC_CatalogSearch>
  5.             <active>true</active>
  6.             <codepool>local</codepool>
  7.         </EC_CatalogSearch>
  8.     </modules>
  9. </config>

does work - EC_All.xml

XML:
  1. <?xml version="1.0"?>
  2. <config>
  3.     <modules>
  4.         <EC_CatalogSearch>
  5.             <active>true</active>
  6.             <codePool>local</codePool>
  7.         </EC_CatalogSearch>
  8.     </modules>
  9. </config>

I think next time I'm just going to use the module creator!

More Reading:

5 Comments

Magic Toolbox
June 16th, 2009

Spotted it - one letter only! codePool not codepool. (Bang head on wall).

Also had a capitalisation problem like this last week with a customer trying to customise one our Magic Zoom Plus module. http://www.magictoolbox.com/magiczoomplus_magento/ Still, Magento mods are a whole lot easier than CRELoaded mods and don't even mention ECommerceTemplates...

 

Eddie May
June 17th, 2009

Hmm,
Good catch - I'm a little surprised that the framework is that picky. Is this how it picks up directory paths or something?
Cheers

 

admin
June 17th, 2009

Its camel case on the codePool bit for anyone that hasn't spotted the difference.

I haven't done any extensive testing but it seems Magento is at once inconsistent in its casing requirements and also quite picky that its the correct case.

I'm surprised as well but there you go. I suppose you only need to get this right once and then you are away. If you copied and pasted a working version you probably wouldn't even notice that it was this picky.

Reminds me of trying to code javascript before the days of firebug et al - zero debugging basically.

As I say in the post, I think in future I will kick off with a template module or one of the module creators. My only concern with the module creators is that they will create more files than I need which could cause me more problems than they solve. In this instance I wanted to override one method in the catalogsearch helper (to strip trailing s from search terms).

 

Dmitry
August 19th, 2009

Framework is not picky... XML is case–sensitive! You should know that if you are a developer.

 

admin
August 19th, 2009

helpful Dmitry,

yes we know its case sensitive, but the issue is with the inconsistent capitalisation in the Magento system.

 

 

Leave a Reply