Предупреждение: строка загрузки simplexml() [функция.simplexml-строка загрузки]


Я часто повторяю следующее в системе magento 1.9.1.1.log. есть идеи?

2015-05-17T09:17:55+00:00 ERR (3): Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: &lt;/layout&gt;  in /home/x/public_html/includes/src/__default.php on line 28961

2015-05-17T09:17:55+00:00 ERR (3): Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]:  ^  in /home/x/public_html/includes/src/__default.php on line 28961

_ код по умолчанию

        // custom local layout updates file - load always last
        $updateFiles[] = 'local.xml';
        $layoutStr = '';
        foreach ($updateFiles as $file) {
            $filename = $design->getLayoutFilename($file, array(
                '_area'    => $area,
                '_package' => $package,
                '_theme'   => $theme
            ));
            if (!is_readable($filename)) {
                continue;
            }
            $fileStr = file_get_contents($filename);
            $fileStr = str_replace($this->_subst['from'], $this->_subst['to'], $fileStr);
            $fileXml = simplexml_load_string($fileStr, $elementClass);
            if (!$fileXml instanceof SimpleXMLElement) {
                continue;
            }
            $layoutStr .= $fileXml->innerXml();
        }
        $layoutXml = simplexml_load_string('<layouts>'.$layoutStr.'</layouts>', $elementClass);
        return $layoutXml;
    }
}

Мой локальный XML

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="footer_links">
<remove name="return_link"/>           
 <action method="removeLinkByUrl"><url helper="catalogsearch/getSearchTermUrl" /></action>
           <action method="removeLinkByUrl"><url helper="catalogsearch/getAdvancedSearchUrl" /></action>
    </reference>
<checkout_cart_index>
        <reference name="content">
            <block name="checkout.cart">
                <remove name="checkout.cart.shipping"/>
            </block>
        </reference>
    </checkout_cart_index>
  <checkout_cart_index>
        <reference name="content">
            <block name="checkout.cart">
                <remove name="checkout.cart.coupon"/>
            </block>
        </reference>
    </checkout_cart_index>
<catalog_product_view>
    <reference name="product.info.additional">
        <action method="unsetChild"><name>product_tag_list</name></action>
    </reference>
</catalog_product_view>
 </default>  
</layout>
Author: 7ochem, 2015-05-17

2 answers

Один из ваших XML-файлов поврежден, используйте эту команду, чтобы найти его:

cd /your/magento/root/dir
find . -type f -name "*.xml" -exec xmllint --noout {} \;

(Я надеюсь, что вы на *никсе)

 7
Author: Fabian Blechschmidt, 2015-07-19 08:12:23

Не уверен, что это настоящая проблема, но ваш local.xml выглядит немного странно. Попробуйте вот это:

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="footer_links">
            <remove name="return_link"/>
            <action method="removeLinkByUrl">
                <url helper="catalogsearch/getSearchTermUrl"/>
            </action>
            <action method="removeLinkByUrl">
                <url helper="catalogsearch/getAdvancedSearchUrl"/>
            </action>
        </reference>
    </default>
    <checkout_cart_index>
        <remove name="checkout.cart.shipping"/>
        <remove name="checkout.cart.coupon"/>
    </checkout_cart_index>
    <catalog_product_view>
        <reference name="product.info.additional">
            <action method="unsetChild">
                <name>product_tag_list</name>
            </action>
        </reference>
    </catalog_product_view>
</layout>

Кроме того, убедитесь, что нет недопустимых XML-файлов. Поэтому используйте неизменную тему по умолчанию и попробуйте отключить все сторонние расширения.

 3
Author: Simon, 2015-05-17 10:19:02