Yea, you heard me, I said STUPID! I hate the bare mention of that word since its mostly used in shallow disputes and does not bring any reasonable arguments to the table by it self. However, let me say that one more time… Magento’s way of handling xml config file attributes is down bottom bad and just stupid.
I just spend around 2 hours trying to figure why my module controller does not work (this happened on latest Magento version 1.3.2.3).
I guess this will be my first post where I focus on keyword “stupid”. I really do not wish to hurt anyone’s feelings, I have no tendency to trash upon other developers. I realize we all make mistakes. I know I make them every day. And as we move along we learn upon those mistakes. Magento can be great platform to learn a lot about PHP and app structures.
However, sometimes when it comes to Magento I simply snap. We do pro Magento development every day. What bothers me the most in this development cycle is that Magento simply silently ignores most of the work flow exceptions and you end up with “WTF just happened” expression on your face when things start to behave “differently”.
Take a look at the two screen shots below.
SCREEN SHOWS THE XML ERROR THAT WILL SILENTLY MAKE YOUR CODE FAIL, AND YOU WILL MOST LIKELY LOOSE COUPLE OF HOURS TRACING THE ISSUE

SCREEN SHOWS THE VALID VERION OF ABOVE XML FILE

Only difference “codepool” vs “codePool”.
Personally, for me this is NOT NORMAL! I strongly believe all two cases should work or at least the first (improper) one should trigger some kind of exception. I believe I am pretty good when it comes to tracing and debugging Magento code but common, how do you explain to your client that you just lost 2 hours for something that falls under the category of “project setup”?!
There are large number of places in code where the errors are simply ignored and fail safe mechanism is put in action. By fail safe I mostly think on try-catch block that have empty or commented out catch blocks. Common people, who can benefit from this? -Ok, no need to answer that
-Some will say this was so cause there are lot of stuff executed trough AJAX, or this is ecommerce solution and errors should be suppressed and so on… I say WTF! I want exceptions, I want errors, at least in dev environment
-Not to mention that Mage::setIsDeveloperMode(true) does not do really much.
Anyhow, to get back to the above mentioned screen shots. They are related to my custom module controller not working. My custom controller kept throwing me 404 page. Reason was the “invalid xml” file.
In large systems like Magento, it can be extremely time consuming to trace something that does not throw error (exception) like above example. At the end of the day it seems to me that Magento’s feature richness prevails in place of all its flaws.
I would like to hear your thoughts on this subject.
Amen to that!
I was in the same situation 2 months ago and the only way to figure out WTF was wrong, was to compare my xmls with the ones from other modules. And to be honest after 10 modules I built, I still struggle with more complex calls. Whoever makes decisions on the Magento feature priority should seriously consider a proper debug system!
//goes to bed after another 12h of Magento phun…
This has been a source of much angst where I work, at least among us developers. You’d think dev mode would be more useful. Argh.
Haha, I’ve had that so often.
To work around that, I’ve made me a lot of code templates for stuff like config.xml, system.xml, Module.xml etc etc.
I use e-texteditor (Windows Textmate clone) to produce code. If anyone would like to share magento snippets, please mail/comment!
I’d post them on snippi.net but that’s strictly for code, not code templates, right?
BTW what is the IDE you’re using there?
man fuck magento! i use oscommerce nextgen version
wow !!! this really suck !!!
I will probably have the same kind of problem so thanks
Yes, i’ve already suffered from the poor config/structure documentation/debugging from Magento. It really really sucks. Lost two hours only to discover that both the names of the Company/Module directories HAVE to start with a capital letter… Magento can be such a pain sometimes…
@Nightfly I’m using Eclipse. About snippi, you can throw in xml files, sql files, phtml files. Not sure if this is what you had in mind.
Cheers.
Hi Branko,
I’ve been seeing your site for about 6 months now. Your site is among the best on the net for Magento coding tips. I’ve been doing a lot of custom Magento stuff with my newest job. I plan on starting a blog of my own on similar Zend and Magento issues. Thanks for all of the great tips though, you have helped save me some work/time.
Jesse
I feel your pain.
Branko, I completely agree, the way Magento handles its XML config files is “stupid”. I look forward to the day that Magento developers like you and I can contribute code that will get merged into the Magento core. If there was that opportunity, I would gladly spend the building in support for error checking of the XML config files.
Of all the time I’ve spent debugging Magento modules, the most frustrating time has been debugging XML errors. During the beginning of my Magento development journey, I spent hours figuring out XML bugs.
I’ve now begun to copy-and-paste a lot of my XML to ensure that I don’t make any typos that would cause me hours of headache in the future.
@Nightfly: I would also recommend Eclipse, especially the PDT variant.
I think everybody who need anything extra than install and put some products feel your pain. I can feel it either
Hello Branko,
I have been searching net since 2 months and found to be active in case of Magento. Thanks for being so.
I have got few issues and most critical being creating a custom shipment module based on parcel force service. I saw your tutorial for creating one from scratch and it gave a little idea. Thanks for it. I need a bit detailed info. like where to place parcel force API’s and what are the further files that need to be coded. Also will this shipping method automatically update total amount on checkout page.
Also may you please highlight some mistakes which normally everybody does in such cases.
Thanking in advance
Kind Regards
Pirzada Jeelani
Ya you are right i have spend my 3 days and i m totally confuse with magento
I would have to agree, as powerful and flexible Magento is, some documentation is badly missing. Not only for the xml, but also for the Mage framework.
I feel like a dog chasing my own tail when I want to do something, even when it’s a simple task.
Hi Branko,
One feature that I’ve seen in another very complex eCommerce system (ATG – its J2EE) is to view the final compiled XML config. So for example, layout – once all the modules have added (or removed!!) to the layout declaration, show the final list of nodes and their attributes.
In my view, this would be extremely helpful in Magento, for layout and also config xmls. What do you think?
Cheers,
Jonathan
I will probably have the same kind of problem so thanks
I will probably have the same kind of problem so thanks
on top of the debugging frustrations….
All this xml parsing is one of the main reasons magento is so damn cpu hungry.
It wil easily cause apache eating up all of your cpu for 2-5 seconds per request.
Awfull… Magento is no green label app.