Search code examples
magentoadminhtml

404 Error on Magento Adminhtml Module


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.


Solution

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