【问题标题】:How to fix url rewrite in config.xml in Magento after applying SUPEE-6788 patch?应用 SUPEE-6788 补丁后,如何在 Magento 的 config.xml 中修复 url 重写?
【发布时间】:2015-11-30 16:23:50
【问题描述】:

我在 Magento 1.4.1.1 中使用 Nastnet OrderPrint 扩展。应用后,我在 config.xml 中面临 url 重写的问题 SUPEE-6788 补丁。

config.xml 中有如下代码

<?xml version="1.0"?>
<config>
    <modules>
        <Nastnet_OrderPrint>
            <version>0.1.3</version>
        </Nastnet_OrderPrint>
    </modules>

    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sales_order_view>Nastnet_OrderPrint_Block_Sales_Order_View</sales_order_view>
                </rewrite>
            </adminhtml>
        </blocks>
        <rewrite>
            <Nastnet_OrderPrint_OrderController>
                <from><![CDATA[#/\w+/sales_order/print/#]]></from>
                <to>/orderprint/order/print/</to>
            </Nastnet_OrderPrint_OrderController>
        </rewrite>
        <models>
            <Nastnet_OrderPrint>
                <class>Nastnet_OrderPrint_Model</class>
            </Nastnet_OrderPrint>
        </models>
        <pdf>
            <order>
                <default>Nastnet_OrderPrint/order_pdf_items_order_default</default>
                <grouped>Nastnet_OrderPrint/order_pdf_items_order_grouped</grouped>
            </order>
        </pdf>
    </global>
    <admin>
        <routers>
            <Nastnet_OrderPrint>
                 <use>admin</use>
                <args>
                    <module>Nastnet_OrderPrint</module>
                    <!-- This is used when "catching" the rewrite above -->
                    <frontName>orderprint</frontName>
                </args>
            </Nastnet_OrderPrint>
        </routers>
    </admin>
</config>

根据管理路由的 SUPEE-6788 补丁的发行说明,我可以使用以下修复。

<adminhtml>
    <args>
        <modules>
            <Nastnet_OrderPrint before="Mage_Adminhtml">Nastnet_OrderPrint_Adminhtml</Nastnet_OrderPrint>
        </modules>
    </args>
</adminhtml>

但是如何解决以下问题

<rewrite>
       <Nastnet_OrderPrint_OrderController>
          <from><![CDATA[#/\w+/sales_order/print/#]]></from>
          <to>/orderprint/order/print/</to>
       </Nastnet_OrderPrint_OrderController>
  </rewrite>

【问题讨论】:

    标签: magento magento-1.9 magento-1.4


    【解决方案1】:

    我评论了重写的代码

      <!-- <rewrite>
       <Nastnet_OrderPrint_OrderController>
          <from><![CDATA[#/\w+/sales_order/print/#]]></from>
          <to>/orderprint/order/print/</to>
       </Nastnet_OrderPrint_OrderController>
    </rewrite> -->
    

    并将控制器移动到以下位置 控制器 > Adminhtml > Emdeleteorders

    require_once 'Mage/Adminhtml/controllers/Sales/OrderController.php';
    
        class EM_DeleteOrder_Adminhtml_Emdeleteorder_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController
        {
    

    对我来说效果很好。

    【讨论】:

      猜你喜欢
      • 2016-02-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-04
      相关资源
      最近更新 更多