0

in my Magento 1 Module i make an MenĂ¼entry 'Script Queue'. In my adminhtml.xml i write this:

<?xml version="1.0"?>
<config>
    <menu>
        <system>
            <children>
                <magentoadminscriptqueue translate="title" module="magentoadminscriptqueue">
                    <sort_order>20</sort_order>
                    <title>Script Queue</title>
                    <action>adminhtml/script/index</action>
                </magentoadminscriptqueue>
            </children>
        </system>
    </menu>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <magentoadminscriptqueue translate="title" module="magentoadminscriptqueue">
                                <title>Script Queue</title>
                                <sort_order>360</sort_order>
                            </magentoadminscriptqueue>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

And in the config.xml i add this:

<?xml version="1.0"?>
<config>
   ...
   <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <magentoadminscriptqueue before="Mage_Adminhtml">UF_MagentoAdminScriptQueue_Adminhtml</magentoadminscriptqueue>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

This is my Controller in the path controller/Adminhtml/ScriptController.php:

<?php

class UF_MagentoAdminScriptQueue_Adminhtml_ScriptController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();

        $block = $this->getLayout()->createBlock('core/text', 'magentoadminscriptqueue-block')->setText('<h1>UF Admin Script Queue</h1>');
        $this->_addContent($block);
        $this->_setActiveMenu('magentoadminscriptqueue_menu')->renderLayout();
    }

    public function getCategoriesAction()
    {

    }

    public function importCategoriesAction()
    {

    }

    public function exportProductToCsvAction()
    {

    }

    public function updateMediaGalleryAction()
    {

    }
}

I see the Menuentry, but when i click on it i get an error 404. Anybody knows what i do wrong or what i forget?

Cheers Kerstel

Kerstel
  • 1
  • 1

1 Answers1

0

In order for the new ACL (AccessControl List, the thing that tells Magento who has rights to use what) you will need to relogin after you "installed" a new module. In your occurence the menupoints route (magentoadminscriptqueue) is not yet in the list of pages you are allowed to visit.

Once you login again your ACL will be updated and therefore you'll be granted access.

Showing an 404 Error is an security measurement to not make it obvious a controller does exist. (Preventing tries to find backdoors into it).

muhkuh2005
  • 57
  • 6