Knowledge Base Article

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.



Rating

Please indicate if this article was helpful for you.

rating :  4.6 from 5
views :  1854
votes :  9

Related Articles

Views

Haven't found what you are looking for? Suggest an article HERE.

powered by

Valid XHTML 1.0 Strict Valid CSS!