15

I am making my first custom module, following a tutorial online. I get that I have to create certain XML files for the system to "discover" my module, but even when I break the XML, I don't see any difference, or I sometimes see a page which tells me there's an error report which is being hidden. How can I find these error reports, and is there a way to get feedback from the system while I am developing?

Here's my file app/etc/modules/BlueAcorn_Test.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <BlueAcorn_ExampleModule>
            <active>true</active>
            <codepool>local</codepool>
        </BlueAcorn_ExampleModule>
    </modules>
</config>

And here's my configuration file at app/code/local/Blueacorn/Example/etc/config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <global>
        <blocks>
            <test>
                <class>BlueAcorn_ExampleModule_Block</class>
            </test>
        </blocks>
        <layout>
            <updates>
                <test>
                    <file>example.xml</file>
                </test>
            </updates>
        </layout>
    </global>
</config>
3
  • +1 for question this is great for beginners who will be visiting the site. should we start posting more of this type of questions? – pzirkind Jan 24 '13 at 16:04
  • 1
    I think it would be good for both beginners to have questions like this answered as well as for us to figure out how we will answer questions which involve multiple "things" – benmarks Jan 24 '13 at 16:20
  • Hey, that smile changes everything! :-) – benmarks Jan 24 '13 at 19:28
7

As for the errors reports, I guess you may need the exception and system logs. Once more, Alan Storm Magento site will come handy Magento Development Environment. Here you will find how to turn ON logging and where to find those log files.

There are other errors that are stored on the var/report/ folder. On my case I have seen only sql updates error to be logged there.

With is there a way to get feedback from the system while I am developing? are you refering to exception handling, logging, etc? Then check this other link: PHP Error Handling and Magento Developer Mode

8

It has to be

<codePool>local</codePool>

with a capital p

6

Magento uses the XML to discover and use different parts of your module.

Sometimes Magento won't say anything if you break the XML, but when you want to use that part of your module, Magento will tell you that it doesn't exist.

One way to avoid XML mistakes (they can be very frustrating to track down sometimes), is to use pre-generated boilerplate XML and class setup files.

SilkSoftware has created a simple "Module Creator" which can save you hours of tedious development.

You can find them here: http://www.silksoftware.com/magento-module-creator/

What they do, is allow you to build the 'skeleton' for your module (without placing any sensitive code in there), they allow you to add blocks, models etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.