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?

1
  • check my answer it will help you. May 16, 2018 at 6:59

3 Answers 3

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>
12
  • What about "rewardpoints_adminform"? May 16, 2018 at 8:43
  • Is that loading directly in admin and is that controller?
    – kunj
    May 16, 2018 at 8:48
  • I have made the changes mentioned by you, flushed cache. Still its not working May 16, 2018 at 9:03
  • Do you have "IndexAction" function in StatsController.php AND ClientpointsController.php files?
    – kunj
    May 16, 2018 at 9:18
  • Yes there is IndexAction Function in both of these controllers, I have tried adding die("testing"); even this is not working. While in other modules die(); is working fine in IndexAction function May 16, 2018 at 9:24
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.

1
  • I have updated my question with acl code and there is no admin layout xml for this module. May 16, 2018 at 7:14
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
10
  • I have mentioned this in my question heading itself. It is perfectly working with this structure (Without any package), That's why I am confused how to make it work with SUPEE-6788 May 16, 2018 at 10:07
  • What have you added in <modules> <{{Module Package}}_{{ModuleName}}> <version>0.1.0</version> </{{Module Package}}_{{ModuleName}}> </modules> for this?
    – kunj
    May 16, 2018 at 10:21
  • And what have you added in app/etc/modules/?
    – kunj
    May 16, 2018 at 10:24
  • RewardPoints.xml updated my question with this file code and added <modules> part of config.xml May 16, 2018 at 10:35
  • Ok, let me try with module
    – kunj
    May 16, 2018 at 10:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.