应用 SUPEE-6788 补丁后,如何修复 Magento 中 config.xml 中的 url 重写?

How to fix url rewrite in config.xml in Magento after applying SUPEE-6788 patch?

我在 Magento 1.4.1.1 中使用 Nastnet OrderPrint 扩展。我在申请后面临 url 在 config.xml 中重写的问题 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>

我评论了重写的代码

  <!-- <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
    {

对我来说效果很好。