Search code examples
magentomodulegridgeturl

Magento, linking grid row links to other modules


I'm generating the row url in a grid via getUrl like this:

return $this->getUrl('*/sales_order/view', array('order_id' =>    $row->getOrderId()));

generates this url:

/index.php/admin/dreamrobot/sales_order/view/order_id/100025028/key/e6ed17d71b33687d7389f5d718d4d739/

My problem is, that 'dreamrobot' shouldn't be in the url, it's the name of my modul, but I want to link to the order view page.

the url genered by getUrl should like this:

/index.php/admin/adminXXXXXX/sales_order/view/order_id/42914/key/e6ed17d71b33687d7389f5d718d4d739/

Any advice what I'm doing wrong ?

Here's a snipped from my config.xml regarding the routers:

 <admin>
    <routers>
<adminhtml>
<args>
<modules>
<dreamrobot after="Mage_Adminhtml">Polyvision_DreamRobot_Adminhtml</dreamrobot>
</modules>
</args>
</adminhtml>
<dreamrobot>
<use>admin</use>
<args>
<module>Polyvision_DreamRobot</module>
<frontName>dreamrobot</frontName>
</args>
</dreamrobot>
</routers>
    </admin>

Solution

  • The answer is not complex. Change '*/sales_order/view' to 'adminhtml/sales_order/view'

    (Or alter your config like this so that your module's URLs are also in the "admin" path)