Knowledgebase

How to fix ‘Fatal error: Call to a member function toHtml() on a non-object’ in Magento?

Sometimes, after a theme installation or a upgrade you can face the following error message in your Magento web site:

Fatal error: Call to a member function toHtml() on a non-object in app/code/core/Mage/Core/Model/Layout.php on line 529

In order to resolve the issue, open the app/design/frontend/default/YOUR_THEME/layout/page.xml file and change the following line:

<block type="core/profiler" output="toHtml"/>

to

<block type="core/profiler" output="toHtml" name="core_profiler"/>

Replace the YOUR_THEME string with the exact name of the Magento theme which you want to use.

Then navigate to your Magento admin area->System->Cache Management and flush your script's cache. Alternatively, you can follow the instructions from the How to clear the cache in Magento article.

Once you are ready, reload your web site.

You need help with a shopping cart? hostlantern is specialized in eCommerce hosting and provides expert support for a large number of shopping carts. Check out our shopping cart hosting services!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to resolve the ‘Invalid package identifier provided’ error in Magento?

The Invalid package identifier provided error occurs when there is a problem with the...

How to alter product price in Magento

Altering the price of products in Magento is an easy task. All you need to do is: Login to...

Magento Contact Us Form

A contact us form is available by default in Magento. A link to it can generally be found in the...

Reindex Magento Data via SSH

The fastest way to reindex Magento data is manually via SSH. To reindex the Magento data...

How to add a module in Magento?

Additional functionality is added to Magento via separate modules called extensions. You can...

Copyright © 2013<script>new Date().getFullYear()>2010&&document.write("-"+new Date().getFullYear());</script>, HostLantern. All Rights Reserved.