You see an XML error either on your screen or in your system.log but, you do not know which XML file has caused it? These tips should help you get started:
- Edit this file on line 432
[magento root]/app/code/core/Mage/Core/Model/Layout/Update.php
add this code:
1234if (!$fileXml instanceof SimpleXMLElement) {<span style="background-color: yellow">// add this log statement - ensure to enable error logging on your shop Mage::log(print_r($filename, true));</span>continue;} - Edit this file on line 515
[magento root]/lib/Varien/Simplexml/Config.php
1234if ($xml instanceof Varien_Simplexml_Element) {$this->_xml = $xml;return true;}<span style="background-color: yellow"> else { // add this else statement to the if - ensure to enable error logging on your shop Mage::log(print_r($string, true)); }</span> - Clear the Magento cache and reload the page you are working on
- Now check your /var/lib/system.log file – you should see the XML filename or the XML string that is causing the error.
Additional Help:
As you must have guessed from the file names of the above files:
- If the error is from this file:
[magento root]/lib/Varien/Simplexml/Config.php on line 510
then it, means there is an error in one of your module config files. Check one of these config.xml files:- [magento root]/app/etc/modules/config.xml
- [module path]/etc/config.xml
- If the error is from this file:
[magento root]/app/code/core/Mage/Core/Model/Layout/Update.php on line 431
then, there is an error in your theme layout XML file.
Hope, this helps you debug faster.
Tagged with: config.xml • layout xml • Magento • Template • xml error
Filed under: Magento eCommerce Tips • Magento eCommerce Tips
Like this post? Subscribe to my RSS feed and get loads more!




Leave a Reply