我在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>
答案 0 :(得分:1)
我评论了重写代码
<!-- <rewrite>
<Nastnet_OrderPrint_OrderController>
<from><![CDATA[#/\w+/sales_order/print/#]]></from>
<to>/orderprint/order/print/</to>
</Nastnet_OrderPrint_OrderController>
</rewrite> -->
并将控制器移动到以下位置 控制器&gt; Adminhtml&gt; Emdeleteorders
require_once 'Mage/Adminhtml/controllers/Sales/OrderController.php';
class EM_DeleteOrder_Adminhtml_Emdeleteorder_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController
{
它对我来说很好。