1

On my Magento 1.6.2.0 http://nilandsplace.com I have /**/ loading before page content and some gray space just under the Logo header and behind the menu. I was working on removing a Google Translate floating box that was in the way of my AddThis buttons. Removing the Script did not seem to remove the "Website Translator" Translate buttom
It took a lot of file exploring to finally get it gone from my Magento. I am sure during this effort I introduced the /**/ but I can't remember or find where it is? The View source shows the error:

<!-- END GOOGLE ANALYTICS CODE -->
/*<script type="text/javascript">var Translator = new Translate({"Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.":"Please use only letters (a-z or A-Z), numbers (0-9) or underscores (_) in this field, first character must be a letter."});</script>*/

It should look like this:

<!-- END GOOGLE ANALYTICS CODE -->
<script type="text/javascript">var Translator = new Translate({"Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.":"Please use only letters (a-z or A-Z), numbers (0-9) or underscores (_) in this field, first character must be a letter."});</script>

I have downloaded the whole site and database but I can't find /*<script ...</script>*/ I have done file compassion to my local copy made inJuly that does not have the error. I have done many kinds of string searches with no joy.
Firebug shows the error, but not were it comes from.
I added some troubleshooting extensions to my Magento only to discover the page is not loading right at all. On my live site I have only 2 layout updates and my local copy has 48. Somehow all the layout updates are merged into to 1 on my live site.
I have been trying to learn how a page is loaded in Magento Layout and Template, but can't seem to find who's on first and whats on second. What loads the page and what layout is first? I have looked in /app/design/frontend/... /base, /default, /enterprise and /pro. The last 2 I don't know why they are there for Magento CE.How do I figure what order things load? Thanks

1

I found a way to find the error at this link http://wrightcreativelabs.com/magento-simplexml_load_string-error-troubleshooting/

I thought I was troubleshooting a different error in my Magento system.log but it turned out to be the error this question was about. The big secret was

Open up Config.php (located at /lib/Varien/Simplexml/Config.php) and go to line 510:

$xml = simplexml_load_string($string, $this->_elementClass);

Below this line, add the following:

if(!$xml){ Mage::log($string); }

after refreshing the cache, I got this in my log file

2014-08-30T16:45:15+00:00 ERR (3): Warning: simplexml_load_string():          ^  in /home/niland55/public_html/lib/Varien/Simplexml/Config.php on line 510
2014-08-30T16:45:15+00:00 DEBUG (7): <?xml version="1.0"?>
<config>
<menu>
<!---        <mgtcommerce translate="title" module="mgt_base">
        <title>Mgt-Commerce.com</title>
        <sort_order>75</sort_order>
        <action>adminhtml/mgt</action>
   </mgtcommerce> --->
</menu>
<acl>
    <resources>
        <all>
          <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <system>
                    <children>
                        <config>
                            <children>
                                <mgt_base>
                                    <title>Mgt-Commerce.com - Module Information</title>
                                </mgt_base>
                            </children>
                        </config>
                    </children>
                </system>
            </children>
        </admin>
    </resources>
</acl>

This allowed me to find the offending file and I deleted the bad comment:

<!---        <mgtcommerce translate="title" module="mgt_base">
        <title>Mgt-Commerce.com</title>
        <sort_order>75</sort_order>
        <action>adminhtml/mgt</action>
   </mgtcommerce> --->

And everything was back to normal

0

The question for loading sequence has already been answered by Ben Marks at this url:

Debugging layout XML loading

He explains how to get update handle and loaded block, by logging this you will also find out the sequence in which your page loads. If you are looking for a block that is a direct child of the page you could also take a look at your page-xmls.

To check in what block a piece of code exist you can turn on template path hints and check in the html source to see what block / template contains the code, alltough this is not easy when you have messy html / alot of childblocks.

-1

Have a look in: Mage_Core_Helper_Js::getTranslatorScript()

app/code/core/Mage/Core/Helper/Js.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.