Jul 13, 2013
kalpesh

Magento system config 404 error

Magento gives 404 error / Forbidden error / Access denied error when you try to open the screen of your newly written config/system XML code because either of 2 reasons.

1.) You have written the code CORRECTLY, but Magento needs to write permissions for that module in session to show it.
- Just logout and login again and you should see your newly developed screen.

2.) You have some error in your ACL role code. Magento needs the ACL role information to allow admin view the admin module.
- Check your ACL code definition again and make sure everything there is correct.

Sample code of ACL to display custom menu item in navigation:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<config>
    <acl>
        <resources>
            <all>
                <title>Allow everything</title>
            </all>
            <admin>
                <children>
                    <mycustommenu translate="title" module="modulename">
                        <title>Custom MENU</title>
                        <sort_order>500</sort_order>
                        <children>
                            <!-- child items go here -->
                            <submenuitem translate="title" module="modulename">
                                <title>Custom SUB MENU</title>
                                <sort_order>10</sort_order>
                            </submenuitem>
                        </children>
                    </mycustommenu>
                </children>
            </admin>
        </resources>
    </acl>
</config>


Sample code of ACL for new submenu under SYSTEM main menu in navigation:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<config>
    <acl>
        <resources>
            <all>
                <title>Allow everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <mycustomsystem>
                                <title>SUB SYSTEM!</title> 
                            </mycustomsystem>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

Sample code of ACL for new screen under System Configuration:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<config>
    <acl>
        <resources>
            <all>
                <title>Allow everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <example translate="title">
                                        <title>An Example Section</title>
                                        <sort_order>100</sort_order>
                                    </example>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

Leave a comment

 

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!

Certifications