我将magento从2.1.2版本更新到了2.2.7。
当我想转到产品页面时,我会看到此错误:
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'referenceContainer', attribute 'before': The attribute 'before' is not allowed.
Line: 1508
Element 'referenceBlock', attribute 'ifconfig': The attribute 'ifconfig' is not allowed.
Line: 1624
我发现不再允许该信息,应该将其删除,但是我不确定我是否理解正确。
示例我有一个这样的块:
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="admin">
<route id="rewards" frontName="rewards">
<module name="Mirasvit_Rewards" before="Magento_Adminhtml"/>
</route>
</router>
</config>
我是否必须先删除该标记以及它是否应该像这样:
<module name="Mirasvit_Rewards"/>
类似于ifconfig:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="page.actions.toolbar">
<block ifconfig="pdfpro/general/enabled" class="Vnecoms\PdfPro\Block\Adminhtml\Sales\Order\PrintButton" as="pdfpro_print_button"/>
</referenceBlock>
</body>
</page>
感谢您的帮助!