Home > Magento, Magento Tutorials > Magento Layout Error Recovery

Magento Layout Error Recovery

Posted on: 22nd Jan 2010 By: Adam Moss 8 Comments

Being a hugely complex system of files and functions, when Magento suddenly goes into error mode – that dreaded page that we are all aware of – it can sometimes be difficult to identify what’s gone wrong. One which I came across recently came completely out of the blue and was related to XML files in the layout folder.

The error appeared like this:

Magento Error

The error output read:

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 106: parser error :
StartTag: invalid element name
in /var/www/vhosts/mywebsite.co.uk/httpdocs/app/code/core/Mage/Core/Model/Layout/Update.php on line 294

The main reason why I wanted to post about this error is that there is absolutely no solution to it anywhere on the Internet, so it requires addressing. As I said, the error relates to modifications made in the /layouts folder as the function in Update.php: ‘public function fetchFileLayoutUpdates()’.

If this error appears you need to restore your layout XML files to their original states – then I would suggest re-inserting your edits one at a time, ensuring that no mistakes are made.

8 Responses to “ Magento Layout Error Recovery ”

  1. Snow
    #1 | 3rd March 2010

    Hi Adam,

    I have this same warning message. The last time it occurred we restored the site and every thing was up and running. This happened again now after 3 months when I tried to update the store name under admin/System/Manage Stores. I am not sure why this error is occurring often.

    Can you please advise.

    Thanks for your help.

  2. Adam
    #2 | 4th March 2010

    Hmm, I’m not entirely sure. Is it exactly the same error as the one I reported or is it slightly different. If it’s exactly the same you could benefit from restoring the XML files as I did.

    Let me see the error if you can.

  3. Mike
    #3 | 28th May 2010

    I think your on to something with it being related to the store name. That was more or less the only change I made this morning, and I am running into a similar issue. Here is mine:

    Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 43: parser error : StartTag: invalid element name in /home/XXXXXX/XXXXXX/app/code/core/Mage/Core/Model/Layout/Update.php on line 431

    Any thoughts?

  4. Adam Moss
    #4 | 1st June 2010

    Hi Mike, have you tried downloading the latest version of Magento and restoring all your XML files. I’ve now had this error crop up twice and an XML restore has worked perfectly both times.

  5. chx
    #5 | 22nd June 2010

    The same problem happened to my website today when I was creating custom module.
    The problem is in the xml file in the /app/etc/modules/
    The xml file started with:

    instead of

    **note that <? must have no space in between**

    After that, I need to disable the module, before deleting it (direct deletion won't make the problem go away).
    To disable it, write "false" instead "true" in the xml file of the new module:
    false

  6. Jason
    #6 | 18th October 2010

    This saved my butt today.. Thanks for posting!!!

  7. chris
    #7 | 29th April 2011

    YOU ARE A CHAMPION!!!! two hours later i find this page, BAM, problem solved. thank you SO SO SO much.

  8. Mike
    #8 | 16th October 2011

    Which XML files are you referring to? I just received this error a few minutes ago.

    I was editing the /app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php file, refreshed the cache and got this error. I rolled back that file and it’s still not working.

    Thanks,

    Mike

Post A Comment

Your comments:
Enclose code snippets within the appropriate tags: [php][/php]   [js][/js]   [xml][/xml]   [css][/css]   [html][/html]
E.g: [php]<?php echo "hello world"; ?>[/php]

Search Blog

Archives

For the record...

Views & opinions in this blog are those of the individual and do not necessarily reflect those of E-commerce Web Design or the Creare Group.