Magento system.xml and 404 error when trying to access the configuration panel

35,835

Solution 1

If it's the 404 in the Admin Console chrome, then your problem is a missing ACL role. Read this article on how to set one up. (self link)

Also, after setting up your ACL role, you'll need to clear out your Magento sessions. Magento caches specific roles in the session, and new sessions won't be automatically added to the cache of users with the super user role.

Solution 2

Hi I think there is something wrong with the action tag in config.xml.

<action>adminhtml/tempest_main</action>

If I am not mistaken this would refer the the adminhtml module found in app/code/core/Mage/Adminhtml.

What is the name of your module and what do you have in your controllers folder.

I believe that the first bit of the action should be the name of your controller and then the path your admin controller and action

The action tag is built in the following manner.

<action>matrixrate/adminhtml_index/index</action>
       |--module--|--controller---|-action-|

HTH

Solution 3

Give acl permission in your config.xml.

<adminhtml>
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <system>
                            <children>
                                <config>
                                    <children>
                                        <tab_name>
                                            <title>Module - All</title>
                                        </tab_name>
                                    </children>
                                </config>
                            </children>
                        </system>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>

Flush the cache, logout and again login.

Share:
35,835
ghostrifle
Author by

ghostrifle

Updated on May 08, 2020

Comments

  • ghostrifle
    ghostrifle about 4 years

    I'm trying to implement some configuration settings for my custom module. I've managed to add a tab and a section in the left navigation bar. But when I want to open a section I get a 404 error page without any further information.

    So far, I've tried anything to get it working.. reading blogs, examples etc. but I can't find the error. Maybe someone of you can explain me what I'm doing wrong.

    My adminhtml.xml:

    <?xml version="1.0" ?>
    <config>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <tempest_section translate="title" module="Tempest">
                                        <title>Tempest</title>
                                    </tempest_section>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </config>
    

    My config.xml:

    <?xml version="1.0"?>
    
    <config>
        <modules>
            <Polyvision_Tempest>
                <version>0.1.0</version>
            </Polyvision_Tempest>
        </modules>
    
    
        <global>
            <helpers>
                <Tempest>
                    <class>Polyvision_Tempest_Helper</class>
                </Tempest>  
            </helpers>
        </global>        
    
        <admin>
            <routers>
                <adminhtml>
                    <args>
                        <modules>
                            <tempest before="Mage_Adminhtml">Polyvision_Tempest_Adminhtml</tempest>
                        </modules>
                    </args>
                </adminhtml>
            </routers>
        </admin>
    
    
        <adminhtml>
            <menu>
                <menu1 translate="title" module="Tempest">
                    <title>polyvision</title>
                    <sort_order>60</sort_order>
                    <children>
                        <menuitem1 module="Tempest">
                            <title>Tempest - Export</title>
                            <action>adminhtml/tempest_main</action>
                        </menuitem1>
                    </children>                
                </menu1>
            </menu>
        </adminhtml>    
    
        <default>
            <tempest>
                <settings>
                    <export_directory>/tmp/</export_directory>
                </settings>
            </tempest>
        </default>
    </config>
    

    My system.xml:

    <?xml version="1.0" ?>
    <config>
        <tabs>
            <polyvision module="Tempest" translate="label">
                <label>polyvision</label>
                <sort_order>100</sort_order>
            </polyvision>
        </tabs>
        <sections>
            <tempest_section module="Tempest" translate="label">
                <label>Tempest-Einstellungen</label>
                <sort_order>200</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
                <tab>polyvision</tab>
                <groups>
                    <settings translate="label">
                        <label>Settings</label>
                        <comment></comment>
                        <sort_order>10</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                        <fields>
                            <export_directory translate="label tooltip comment">
                                <label>My Custom Field</label>
                                <comment>Some comment about my field</comment>
                                <tooltip>Field ToolTip</tooltip>
                                <show_in_default>1</show_in_default>
                                <show_in_website>1</show_in_website>
                                <show_in_store>1</show_in_store>
                            <frontend_input>text</frontend_input>
                            <source_model>adminhtml/system_config_text</source_model>
                        </export_directory>
                    </fields>
                </settings>
            </groups>
        </tempest_section>
    </sections>
    

    Well, my module itself works without hassles. Only the admin settings are not working :/

  • ghostrifle
    ghostrifle almost 13 years
    Well, sorry but that seems not be the error. If I change this action tag, then I'll cant open the module. Using the module is no problem so far, only System/Configuration does not work then I open the polyvision-TAB in the configuration panel.
  • ghostrifle
    ghostrifle almost 13 years
    Thanx ! The examples on this site are more clear than all the other stuff I've found in my book and on blogs etc.
  • Ivan Ivanic
    Ivan Ivanic over 12 years
    Thanks Alan. /rantmode This is f*cking unbelievable that you gotta clear out session and that is not written anywhere. I was banging my head for about five hours yesterday for this simple reason. And what is the worse in it is that if I got accidentally logged out it would have worked, and I would not know why... /endrantmode Well back to usual Magento problems :)
  • bensnider
    bensnider about 12 years
    I didn't have to create ACL roles, but I did just rm -fr var/cache/* var/session/* and it worked. Magento...
  • Sukeshini
    Sukeshini almost 10 years
    Thanks a lot Alan Storm and +1, I was struggling with this issue
  • Alan
    Alan almost 9 years
    I've created ACL, cleared /var/cache/ and /var/session/ and cache via backed, logged out-in and I still get 404. Any other ideas?
  • Alan Storm
    Alan Storm almost 9 years
    @Alan Look at the System Configuration Admin controller and see what information is missing that makes Magento throw the exception leading to the 404 page.
  • Alan
    Alan almost 9 years
    @AlanStorm thanks Alan, I've mixed tutorials and placed <acl> in adminhtml.xml. Once I've moved it to config.xml, exactly as shown on your website, it worked!
  • Alan Storm
    Alan Storm almost 9 years
    @Alan It may be that you're using an older version of Magento that didn't load adminhtml.xml, or that your adminhtml.xml had some additional nodes in it that were not needed (reference the stock core Modules for information on that). Glad it's sorted!
  • dchayka
    dchayka over 7 years
    5 year old post and still saved my ass :)
  • Spencer Williams
    Spencer Williams over 7 years
    I am sad to say that I am following @AlanStorm's tutorial yet I too am getting the 404 page with missing left-hand navigation at the step where it says I should see a 'blank config page titled “Hello World Config Options”'. I'm doing this on two different computers and getting the same results after logging in and out and deleting the cache and session folders. I feel like it will be another 5 years before I find a solution...
  • Spencer Williams
    Spencer Williams over 7 years
    Please take a look at my code and let me know if you see what I'm doing wrong.
  • Spencer Williams
    Spencer Williams over 7 years
    It would appear the code I uploaded has a typo! Basically, I setup ACL in config.xml for admin/system/config/helloworld_options yet defined a helloworld_option section. After correcting that mistake, I'm now seeing the config section that was defined.