0

I am adding in a new mass action for the sales order grid and when I am putting in the url for my action Magento cannot find my controller.

config.xml

<admin>
    <routers>
        <mymodule>
        <use>admin</use>
        <args>
            <module>Namespace_mymodule</module>
            <frontName>frontendname</frontName>
        </args>
        </mymodule>
    </routers>
</admin>

<global>
    <events>
        <adminhtml_block_html_before>
        <observers>
            <mymodule>
            <class>Namespace_mymodule_Model_Observer</class>
            <method>addActions</method>
            </mymodule>
        </observers>
        </adminhtml_block_html_before>
    </events>
</global>

observer.php

public function addActions($event)
{
    $block = $event->getBlock();
    if($block instanceof Mage_Adminhtml_Block_Sales_Order_Grid)
    {
        $block->getMassactionBlock()->addItem('cpsync', array(
            'label' => 'Push Orders to CounterPoint',
            'url' => Mage::helper("adminhtml")->getUrl("frontendname/adminhtml_index/push/")
        ));
    }
}

Whenever I try to use my mass action it sends me to a 404 redirect page with url

sitename.com/index.php/frontendname/adminhtml_index/push/key/

Robert Zeno
  • 67
  • 1
  • 14
  • You might be interested in my free/open source "Better 404" module. It replaces Magento's standard 404 page with a 404 that contains diagnostic information on why Magento thinks it can't find your page. http://alanstorm.com/magento-404-debug – Alana Storm Feb 08 '14 at 01:26

1 Answers1

0

I think your config.xml is wrong. In the above config.xml, you havent mentioned about the model, block or helper classes. You had just declared about the module and an event. Here is the basic config.xml that you have to follow. Try to modify your config.xml as below.

    <?xml version="1.0"?>
<config>
    <modules>
        <Test_Helloworld>
            <version>0.1.0</version>
        </Test_Helloworld>
    </modules>
    <frontend>
        <routers>
            <helloworld>
                <use>standard</use>
                <args>
                    <module>Test_Helloworld</module>
                    <frontName>helloworld</frontName>
                </args>
            </helloworld>
        </routers>
        <layout>
            <updates>
                <helloworld>
                    <file>helloworld.xml</file>
                </helloworld>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <helloworld>
                <class>Test_Helloworld_Block</class>
            </helloworld>
        </blocks>
        <helpers>
            <helloworld>
                <class>Test_Helloworld_Helper</class>
            </helloworld>
        </helpers>
    </global>
</config> 
Pavan Kumar
  • 1,735
  • 2
  • 28
  • 47