0

I am getting 404 error page in my custom module admin url.

My admin end url like magento1.9/index.php/admin/fortuneform/index/key/43a83958a538fd0a628c3236d4d059f7/

Once I am click this url it goes to frontend with same url and shows 404 error page.

config.xml file :

<?xml version="1.0"?>
<config>
    <modules>
        <Fortunesoft_Fortuneform>
            <version>0.1.0</version>
        </Fortunesoft_Fortuneform>
    </modules>
    <frontend>
        <routers>
            <fortuneform>
                <use>standard</use>
                <args>
                    <module>Fortunesoft_Fortuneform</module>
                    <frontName>fortuneform</frontName>
                </args>
            </fortuneform>
        </routers>
        <layout>
            <updates>
                <fortuneform>
                    <file>fortuneform.xml</file>
                </fortuneform>
            </updates>
        </layout>
    </frontend>
    <admin>
    <routers>
        <fortuneform>
            <use>admin</use>
            <args>
                <modules>
                    <fortuneform before="Mage_Adminhtml">Fortunesoft_Fortuneform_Adminhtml</fortuneform>
                </modules>                  
            </args>
        </fortuneform>
    </routers>
</admin>
<global>
        <models>
            <fortuneform>
                <class>Fortunesoft_Fortuneform_Model</class>
                <resourceModel>fortuneform_mysql4</resourceModel>
            </fortuneform>
            <fortuneform_mysql4>
                <class>Fortunesoft_Fortuneform_Model_Mysql4</class>
                <entities>
                    <fortuneform>
                        <table>fortuneform</table>
                    </fortuneform>
                </entities>
            </fortuneform_mysql4>
        </models>
        <resources>
            <fortuneform_setup>
                <setup>
                    <module>Fortunesoft_Fortuneform</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </fortuneform_setup>
            <fortuneform_write>
                <connection>
                    <use>core_write</use>
                </connection>    
            </fortuneform_write>
            <fortuneform_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </fortuneform_read>
        </resources>
        <blocks>
            <fortuneform>
                <class>Fortunesoft_Fortuneform_Block</class>
            </fortuneform>
        </blocks>
        <helpers>
            <fortuneform>
                <class>Fortunesoft_Fortuneform_Helper</class>
            </fortuneform>
        </helpers>
    </global>
</config>   

adminhtml.xml file :

<?xml version="1.0"?>
<config>
    <menu><fortuneform module="fortuneform">
            <title>Fortuneform</title>
            <sort_order>71</sort_order>
            <children>
                <items module="fortuneform">
                    <title>Manage Items</title>
                    <sort_order>0</sort_order>
                  <action>adminhtml/fortuneform</action>
                </items>
            </children>
        </fortuneform></menu>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <fortuneform>
                        <title>Fortuneform Module</title>
                        <sort_order>200</sort_order>
                    </fortuneform>
                </children>
            </admin>
        </resources>   
    </acl>
    <layout>
        <updates>
            <fortuneform>
                <file>fortuneform.xml</file>
            </fortuneform>
        </updates>
    </layout>

adminhtml/default/default/layout/fortuneform.xml

<?xml version="1.0"?>
 <layout version="0.1.0">
    <fortuneform_adminhtml_fortuneform_index>
        <reference name="content">
            <block type="fortuneform/adminhtml_fortuneform" name="fortuneform" />
        </reference>
    </fortuneform_adminhtml_fortuneform_index>
 </layout>

Controllers/Adminhtml/FortuneformController.php file :

class Fortunesoft_Fortuneform_Adminhtml_FortuneformController extends  Mage_Adminhtml_Controller_Action
{

    protected function _initAction()
    {
        $this->loadLayout()
            ->_setActiveMenu('fortuneform/items')
            ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
        return $this;
    }   

    public function indexAction() {
        $this->_initAction();       
        $this->_addContent($this->getLayout()->createBlock('fortuneform/adminhtml_fortuneform'));
        $this->renderLayout();
    } }

Please help me....

9
  • please use magento1.9/admin/index.php/fortuneform/index/ Commented May 22, 2014 at 9:17
  • I am developing module based on link this tutorial. It not have any <frontName> Commented May 22, 2014 at 9:18
  • You have create app/etc/modules/Fortunesoft_Fortuneform.xml ? Commented May 22, 2014 at 9:19
  • First please check your module will be show in admin or not. system>confirgration>Advanced>Advanced by this name Fortunesoft_Fortuneform Commented May 22, 2014 at 9:21
  • <?xml version="1.0"?> <config> <modules> <Fortunesoft_Fortuneform> <active>true</active> <codePool>local</codePool> </Fortunesoft_Fortuneform> </modules> </config> Commented May 22, 2014 at 9:22

2 Answers 2

1

Your adminhtml.xml should look like this. It has action defined as

<action>adminhtml/fortuneform</action>

but it should be <action>fortuneform/adminhtml_fortuneform</action>

<?xml version="1.0"?>
<config>

    <menu>
    <fortuneform module="fortuneform">
            <title>Fortuneform</title>
            <sort_order>71</sort_order>
            <children>
                <items module="fortuneform">
                    <title>Manage Items</title>
                    <sort_order>0</sort_order>
                  <action>fortuneform/adminhtml_fortuneform</action> 
                </items>
            </children>
        </fortuneform>
    </menu>

    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <fortuneform>
                        <title>Fortuneform Module</title>
                        <sort_order>200</sort_order>
                    </fortuneform>
                </children>
            </admin>
        </resources>   
    </acl>
    <layout>
        <updates>
            <fortuneform>
                <file>fortuneform.xml</file>
            </fortuneform>
        </updates>
    </layout>

</config>

Replace config.xml with below code

<?xml version="1.0"?>
<config>
    <modules>
        <Fortunesoft_Fortuneform>
            <version>0.1.0</version>
        </Fortunesoft_Fortuneform>
    </modules>
    <frontend>
        <routers>
            <fortuneform>
                <use>standard</use>
                <args>
                    <module>Fortunesoft_Fortuneform</module>
                    <frontName>fortuneform</frontName>
                </args>
            </fortuneform>
        </routers>
        <layout>
            <updates>
                <fortuneform>
                    <file>fortuneform.xml</file>
                </fortuneform>
            </updates>
        </layout>
    </frontend>


        <admin>
        <routers>
            <fortuneform>
                <use>admin</use>
                <args>
            <fortuneform before="Mage_Adminhtml">Fortunesoft_Fortuneform_Adminhtml</fortuneform>
                    <frontName>fortuneform</frontName>
                </args>
            </fortuneform>
        </routers>
    </admin>


<global>
        <models>
            <fortuneform>
                <class>Fortunesoft_Fortuneform_Model</class>
                <resourceModel>fortuneform_mysql4</resourceModel>
            </fortuneform>
            <fortuneform_mysql4>
                <class>Fortunesoft_Fortuneform_Model_Mysql4</class>
                <entities>
                    <fortuneform>
                        <table>fortuneform</table>
                    </fortuneform>
                </entities>
            </fortuneform_mysql4>
        </models>
        <resources>
            <fortuneform_setup>
                <setup>
                    <module>Fortunesoft_Fortuneform</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </fortuneform_setup>
            <fortuneform_write>
                <connection>
                    <use>core_write</use>
                </connection>    
            </fortuneform_write>
            <fortuneform_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </fortuneform_read>
        </resources>
        <blocks>
            <fortuneform>
                <class>Fortunesoft_Fortuneform_Block</class>
            </fortuneform>
        </blocks>
        <helpers>
            <fortuneform>
                <class>Fortunesoft_Fortuneform_Helper</class>
            </fortuneform>
        </helpers>
    </global>
</config>

Also your controller folder name should be controller i.e. in lower case

Clear your cache and try

Sign up to request clarification or add additional context in comments.

6 Comments

Deleted cache folder, cleared admin cache, flush cache storage and cleared my browser history and cache... but still no luck :-(
Yes you are correct, when I change Contollers to controllers its working. But I am getting a blank page in my admin end. ie) Header and footer okay, but the content section am getting blank/empty.
You can change your adminhtml.xml and config.xml as posted above and that should be good to go.
I tried everything, my link look likes index.php/fortuneform/adminhtml_fortuneform/index/key/dfa53582fc64ac52bd084130a5fd4ee8/ but its showing blank in the content area, is I need to change any other file?
In your indexAction, echo-exit. If the function is called, you are on right path.
|
0

You controller path should be

controllers/Adminhtml/FortuneformController.php (lowercase c in controllers)

Not

Controllers/Adminhtml/FortuneformController.php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.