Question

This problem is driving us nuts, already couple of hours and nothing, I'm getting a 404 error when trying to access the second submenu, the Keywords one. I'm sure the error should be either on the controller or in the layout but no way I can find it. I'm posting my config, controller and layout files. If more are needed can add it too, but I think with these ones will be enough. I'm using the CommerceBug from AlanStorm and the blocks and grids are all correctly loading.

Here are my different files codes:

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Dts_Allpages>
            <version>0.1.0</version>
        </Dts_Allpages>
    </modules>
    <global>
        <models>
            <allpages>
                <class>Dts_Allpages_Model</class>
                <resourceModel>allpages_resource</resourceModel>
            </allpages>
            <allpages_resource>
                <class>Dts_Allpages_Model_Resource</class>
                <entities>
                    <referencedpages>
                        <table>referencedpages</table>
                    </referencedpages>
                    <keywords>
                        <table>keywords</table>
                    </keywords>
                </entities>
            </allpages_resource>
        </models>
        <events>
            <controller_action_predispatch>
                <observers>
                    <controller_action_before>
                        <class>allpages/observer</class>
                        <method>saveReferrer</method>
                    </controller_action_before>
                </observers>
            </controller_action_predispatch>
        </events>
        <helpers>
            <allpages>
                <class>Dts_Allpages_Helper</class>
            </allpages>
        </helpers>
        <resources>
            <allpages_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </allpages_write>
            <allpages_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </allpages_read>
        </resources>
        <blocks>
          <allpages>
            <class>Dts_Allpages_Block</class>
          </allpages>
        </blocks>
    </global>
    <admin>
        <routers>
            <allpages>
                <use>admin</use>
                    <args>
                        <module>Dts_Allpages</module>
                        <frontName>allpages</frontName>
                    </args>
            </allpages>
        </routers>
    </admin>
    <adminhtml>
        <menu>
          <allpagesmainmenu translate="title" module="allpages">
            <title>AllPages</title>
            <sort_order>100</sort_order>
            <children>
              <allpages module="allpages">
                <title>Keywords administration</title>
                <sort_order>0</sort_order>
                <children>
                    <references translate="title">
                        <title>References</title>
                        <sort_order>10</sort_order>
                        <action>allpages/adminhtml_allpagesbackend</action>
                    </references>
                    <keywords translate="title">
                        <title>Keywords</title>
                        <sort_order>20</sort_order>
                        <action>allpages/adminhtml_keywordsbackend</action>
                    </keywords>
                </children>
              </allpages>
            </children>
          </allpagesmainmenu>
        </menu>
        <acl>
          <resources>
            <admin>
              <children>
                <allpagesmainmenu translate="title" module="allpages">
                  <title>All Pages</title>
                  <children>
                    <allpages translate="title">
                        <title>Keywords administration</title>
                        <children>
                            <references translate="title">
                                <title>References</title>
                                <sort_order>10</sort_order>
                            </references>
                            <keywords translate="title">
                                <title>Keywords</title>
                                <sort_order>20</sort_order>
                            </keywords>
                        </children>
                    </allpages>
                  </children>
                </allpagesmainmenu>
              </children>
            </admin>
          </resources>
        </acl>
        <layout>
          <updates>
            <allpages>
              <file>allpages.xml</file>
            </allpages>
          </updates>
        </layout>
    </adminhtml>
</config>

KeywordsbackendController.php

<?php
class Dts_Allpages_Adminhtml_KeywordsbackendController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->_title($this->__("Administrador de keywords"));
        $this->renderLayout();
    }
}

The layout, allpages.xml

<?xml version="1.0"?>
<layout version="0.1.0">
  <allpages_adminhtml_allpagesbackend_index>
      <reference name="content">
          <block type="allpages/adminhtml_allpagesbackend" name="allpagesbackend"/>
      </reference>
  </allpages_adminhtml_allpagesbackend_index>
  <allpages_adminhtml_allpagesbackend_edit>
      <reference name="content">
          <block type="allpages/adminhtml_allpagesbackend_edit" name="allpagesbackend_edit" />
      </reference>
  </allpages_adminhtml_allpagesbackend_edit>
  <allpages_adminhtml_keywordsbackend_index>
      <reference name="content">
          <block type="allpages/adminhtml_keywordsbackend" name="keywordsbackend"/>
      </reference>
  </allpages_adminhtml_keywordsbackend_index>
  <allpages_adminhtml_keywordsbackend_edit>
        <reference name="content">
            <block type="allpages/adminhtml_keywordsbackend_edit" name="keywordsbackend_edit" />
        </reference>
  </allpages_adminhtml_keywordsbackend_edit>
</layout>
Was it helpful?

Solution

Everything was ok. The problem was on the name of the file as I don't know how the controller name was KeywordsbackendController.php.php and of course, the file was not found. But the weird thing is that I didn't had any exception or alike. Well, Magento obscure internals, I'm getting used to it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top