Magento – Maximum function nesting level of ‘1000’ reached, aborting

magento-1.6php-5.4

I have created custom admin module it's showing empty page without adding <stores/> tag in config.xml file if I adding <stores/> tag it's returning an error.

error is:

Fatal error: Maximum function nesting level of '1000' reached, aborting! in C:\xampp\htdocs\magento\app\Mage.php on line 185

//config.xml file

<stores>
        <admin>
            <design>
                <package>
                    <name>default</name>
                </package>
                <theme>
                    <default>Department</default>
                </theme>
            </design>
        </admin>
    </stores>

Can you tell my bug where it is?

thanks in advance.

Best Answer

This error is quite good. It normally means that you implemented some circle, endless recursion or something like that.

After this error you normally get a stack trace where you can see, what functions are called. Have a look, hook into the methods and check why you have a so much nested methods.

Anshu is right, if it is necessary to call a lot of functions, it might help to increase the max_nesting_level.