1

I am using Magento 1.9.2.1 and after installing SUPEE-6788 I have fixed all of the affected modules as described here.

All of my modules (That has a package directory eg: "app/code/local/{module_package}/{module_name}" ) which were not working after installation of this patch are now working fine now.

I have a module which is working fine without SUPEE-6788 and it has no package folder.

Following are the details of the only module which is not working in admin and giving page 404:

Path to module : app/code/{code_pool}/Rewardpoints (where Rewardpoints is the module name)

Some of the code from Config.xml:

<modules>
    <Rewardpoints>
        <version>0.6.1</version>
        <depends>
            <Mage_Customer />
            <Mage_Checkout />
        </depends>
    </Rewardpoints>
</modules>
<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <rewardpoints before="Mage_Adminhtml">Rewardpoints_Adminhtml</rewardpoints>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
<adminhtml>
    <layout>
        <updates>
            <rewardpoints>
                <file>rewardpoints.xml</file>
            </rewardpoints>
        </updates>
    </layout>
    <menu>
        <rewardpoints translate="title" module="rewardpoints">
            <title>Reward Points</title>
            <sort_order>50</sort_order>
            <children>
                <stats translate="title" module="rewardpoints">
                    <title>Statistics</title>
                    <sort_order>2</sort_order>
                    <action>adminhtml/rewardpoints_stats</action>
                </stats>
                <clientpoints translate="title" module="rewardpoints">
                    <title>Client points</title>
                    <sort_order>3</sort_order>
                    <action>adminhtml/rewardpoints_clientpoints</action>
                </clientpoints>
                <config translate="title" module="rewardpoints">
                    <title>Configuration</title>
                    <sort_order>8</sort_order>
                    <action>adminhtml/system_config/edit/section/rewardpoints</action>
                </config>
            </children>
        </rewardpoints>
    </menu>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <rewardpoints module="rewardpoints">
                        <title>Reward Points</title>
                        <sort_order>50</sort_order>
                        <children>
                            <stats translate="title" module="rewardpoints">
                                <title>Statistics</title>
                                <sort_order>2</sort_order>
                            </stats>
                            <clientpoints translate="title" module="rewardpoints">
                                <title>Client points</title>
                                <sort_order>3</sort_order>
                            </clientpoints>
                            <config translate="title" module="rewardpoints">
                                <title>Configuration</title>
                                <sort_order>4</sort_order>
                            </config>
                        </children>
                    </rewardpoints>
                </children>
            </admin>
        </resources>
    </acl>
    <acl>
        <resources>
            <admin>
                <children>
                    <catalog>
                        <children>
                            <rewardpoints_adminform>
                                <title>Configuration</title>
                            </rewardpoints_adminform>
                        </children>
                    </catalog>
                </children>
            </admin>
        </resources>
    </acl>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <rewardpoints>
                                        <title>Reward Points</title>
                                    </rewardpoints>
                                </children>
                            </config>
                        </children>
                    </system>
                    <customer>
                        <children>
                            <rewardpoints translate="title">
                                <title>Reward Points</title>
                                <sort_order>41</sort_order>
                            </rewardpoints>
                        </children>
                    </customer>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>

Path to controllers:

app/code/{code_pool}/Rewardpoints/controllers/Adminhtml/Rewardpoints/StatsController.php

app/code/{code_pool}/Rewardpoints/controllers/Adminhtml/Rewardpoints/ClientpointsController.php

Class for StatsController.php:

class Rewardpoints_Adminhtml_Rewardpoints_StatsController extends Mage_Adminhtml_Controller_action

Class for ClientpointsController.php:

class Rewardpoints_Adminhtml_Rewardpoints_ClientpointsController extends Mage_Adminhtml_Controller_action

IndexAction Function in StatsController.php:

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

IndexAction Function in ClientpointsController.php:

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

Content in app/etc/modules/RewardPoints.xml :

<?xml version="1.0"?>
<config>
    <modules>
        <Rewardpoints>
            <active>true</active>
            <codePool>{{code_pool}}</codePool>
        </Rewardpoints>
    </modules>
</config>

Note 1: Even die(); function is not working in the above IndexAction methods.

Note 2: The module is working fine in admin without SUPEE-6788 Patch.

There is no layout xml file for adminhtml

Is there anything I am missing here?

Wasiq Shahrukh
  • 592
  • 1
  • 6
  • 32

3 Answers3

2

Add ACL inside <adminhtml>:

<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <rewardpoints>
                    <title>Rewardpoints Module</title>
                    <sort_order>10</sort_order>                     
                </rewardpoints>
            </children>
        </admin>
    </resources>
</acl>

Check those points also:

Under controllers folder, you have an Adminhtml folder controllers names are named correctly and action method is called successfully

admin layout folder contain the right action handler /app/design/adminhtml/default/default/layout/your_module.xml which call the right block name.

ACL node is defined correctly in adminhtml.xml or config.xml _isAllowed() method is not overrided and if it's the case try to check $resource parameter of isAllowed() method

clean the cache and check.

Nikunj Vadariya
  • 4,037
  • 1
  • 20
  • 30
2

You need only this Acl:

<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <system>
                    <children>
                        <config>
                            <children>
                                <rewardpoints>
                                    <title>Reward Points</title>
                                </rewardpoints>
                            </children>
                        </config>
                    </children>
                </system>
                <rewardpoints module="rewardpoints">
                    <title>Reward Points</title>
                    <sort_order>50</sort_order>
                    <children>
                        <stats translate="title" module="rewardpoints">
                            <title>Statistics</title>
                            <sort_order>2</sort_order>
                        </stats>
                        <clientpoints translate="title" module="rewardpoints">
                            <title>Client points</title>
                            <sort_order>3</sort_order>
                        </clientpoints>
                        <config translate="title" module="rewardpoints">
                            <title>Configuration</title>
                            <sort_order>4</sort_order>
                        </config>
                    </children>
                </rewardpoints>
                <customer>
                    <children>
                        <rewardpoints translate="title">
                            <title>Reward Points</title>
                            <sort_order>41</sort_order>
                        </rewardpoints>
                    </children>
                </customer>
            </children>
        </admin>
    </resources>
</acl>

Remove others and clear cache then try again.

For specification: This is for your setting configuration fields:

<system>
   <children>
      <config>
         <children>
            <rewardpoints>
               <title>Reward Points</title>
            </rewardpoints>
         </children>
      </config>
   </children>
</system>

And this is if you have added action to customer action:

<customer>
   <children>
      <rewardpoints translate="title">
         <title>Reward Points</title>
         <sort_order>41</sort_order>
      </rewardpoints>
   </children>
</customer>
kunj
  • 3,699
  • 2
  • 10
  • 25
1

I think something is wrong in your module, Where is "module package"?

I mean your module should like this:

app/code/{code_pool}/{Module Package}/Rewardpoints/Adminhtml/Rewardpoints/StatsController.php

app/code/{code_pool}/{Module Package}/Rewardpoints/Adminhtml/Rewardpoints/ClientpointsController.php

Your Admin controller file path should be Like this:

app/code/local/{{Module Package}}/Rewardpoints/controllers/Adminhtml

Class also should be like this:

class {{Module Package}}_Rewardpoints_Adminhtml_Rewardpoints_StatsController extends Mage_Adminhtml_Controller_action


class {{Module Package}}_Rewardpoints_Adminhtml_Rewardpoints_ClientpointsController extends Mage_Adminhtml_Controller_action
kunj
  • 3,699
  • 2
  • 10
  • 25