Question

I've created a fairly straight forward module for mageneto with an administration section.

The Admin section works perfectly except that I get a 404 error when I hit 'Add Item'.

What is particularly odd is that the 'new' action just forwards to the 'edit' action and the edit action works fine:

public function newAction()
{
    $this->_forward('edit');
}

All the forum posts I've read suggests that this is an issue with the ACL as set in my config.xml but I've tried endless permutation and combinations, loggin out and back in again to test them all and none of them seem to work.

The ACL section of config.xml looks like this:

<acl>
<resources>
    <all>
        <title>Allow Everything</title>
    </all>
    <admin>
        <children>
            <press>
                <title>Press Module</title>
                <sort_order>10</sort_order>
            </press>
        </children>
    </admin>
</resources>

Also, if I change the newAction to just echo something it works fine.

Any other ideas about what it could be? Surely if the controller just forwards to the Edit page and the edit page is fine I shouldn't be seeing a 404 error.

Was it helpful?

Solution

A bit of a shot in the dark but perhaps you could try $this->_redirect() instead of _forward

OTHER TIPS

You are missing something in your module config.xml. I was facing same situation but when I added the following code ... it work fine for me

<admin>
    <routers>
        <yourmodule>
            <use>admin</use>
            <args>
                <module>Yournamespace_Yourmodule</module>
                <frontName>yourmodule</frontName>
            </args>
        </yourmodule>
    </routers>
</admin>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top