dqzve68846 2019-01-14 18:51
浏览 41

从2.1.2到2.2.7更新Magento之后ifconfig和不工作之后

I updated the magento from version 2.1.2 to 2.2.7.

When i want to go to the product page then i see this error:

    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

I have found the information that it is no longer allowed and should be removed but I'm not sure if I understand correctly.

Example i have a block like this:

 <?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>

Do I have to remove the tag before and whether it should look like this:

<module name="Mirasvit_Rewards"/>

Similarly for 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>

I will be grateful for any help!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 任务A:大数据平台搭建(容器环境)怎么做呢?
    • ¥15 r语言神经网络自变量重要性分析
    • ¥15 基于双目测规则物体尺寸
    • ¥15 wegame打不开英雄联盟
    • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
    • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
    • ¥30 eclipse开启服务后,网页无法打开
    • ¥30 雷达辐射源信号参考模型
    • ¥15 html+css+js如何实现这样子的效果?
    • ¥15 STM32单片机自主设计