36

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 :/

7ochem
  • 2,035
  • 1
  • 29
  • 37
ghostrifle
  • 1,029
  • 1
  • 13
  • 24

3 Answers3

76

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.

Alan Storm
  • 157,413
  • 86
  • 367
  • 554
  • 2
    Thanx ! The examples on this site are more clear than all the other stuff I've found in my book and on blogs etc. – ghostrifle Jun 21 '11 at 14:03
  • 8
    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 :) – Ivan Ivanić Dec 08 '11 at 08:03
  • 3
    I didn't have to create ACL roles, but I did just `rm -fr var/cache/* var/session/*` and it worked. Magento... – bensnider Apr 11 '12 at 12:54
  • Thanks a lot Alan Storm and +1, I was struggling with this issue – Sukeshini Jul 30 '14 at 10:55
  • 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 Jun 18 '15 at 07:17
  • 1
    @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 Storm Jun 18 '15 at 07:23
  • @AlanStorm thanks Alan, I've mixed tutorials and placed `` in adminhtml.xml. Once I've moved it to config.xml, exactly as shown on your website, it worked! – Alan Jun 18 '15 at 08:41
  • @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! – Alan Storm Jun 18 '15 at 16:09
  • 5 year old post and still saved my ass :) – dchayka Sep 29 '16 at 15:16
  • I am sad to say that I am following @AlanStorm's [tutorial](http://alanstorm.com/custom_magento_system_configuration/) 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 Jan 17 '17 at 17:46
  • Please [take a look at my code](https://github.com/enderandpeter/magento-helloworld) and let me know if you see what I'm doing wrong. – Spencer Williams Jan 17 '17 at 18:12
  • 1
    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. – Spencer Williams Jan 19 '17 at 17:36
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

Gabriel Spiteri
  • 4,596
  • 10
  • 39
  • 57
  • 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 Jun 21 '11 at 11:39
1

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.

biplab rout
  • 176
  • 9