2

After applying patch 6788, I know that config.xml must be edited. My extension does not have the Adminhtml folder and its xml file, so after making changes still I'm getting 404. Below is the config.xml. What would be the correct "action" statement?

<?xml version="1.0"?>

<config>
    <modules>
        <J_G>
            <version>1.0.0</version>
        </J_G>
    </modules>

    <global>
        <helpers>
            <g>
                <class>J_G_Helper</class>
            </g>
        </helpers>

        <blocks>
            <j_g>
                <class>J_G_Block</class>
            </j_g>
        </blocks>
    </global>


    <admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <J_G after="Mage_Adminhtml">J_G_Adminhtml</J_G>
                    <frontName>g</frontName>
                </modules> 
            </args> 
        </adminhtml> 
    </routers> 
</admin> 

    <adminhtml>
        <menu>
            <gr>
                <children>
                    <custom translate="title" module="g">
                        <title>Custom</title>
                        <sort_order>90</sort_order>
                        <children>
                            <sales translate="title" module="g">
                                <title>Sales</title>
                                <sort_order>10</sort_order>
                                <children>
                                    <top translate="title" module="g">
                                        <title>Payment Method</title>
                                        <sort_order>10</sort_order>
                                        <action>adminhtml/g_sales_paymentmethod</action>
                                    </top>
                                </children>
                            </sales>
                        </children>
                    </custom>
                </children>
            </gr>
        </menu>.... 
  • When you register your admin router after Mage_Adminhtml, there is no need to have that extra frontname. Path you have specified in menu action, will be resolved into controllers/G/Sales/PaymentmethodController.php file, make sure you have that in place. – Prateek Nov 3 '15 at 9:47
  • Can you pleas tell me location of controller (admincontroller files) – Amit Bera Nov 3 '15 at 9:50
  • J/G/controllers/Sales/Paymentmethodcontrollers.php is the path – Zinat Nov 3 '15 at 9:51
  • after the controllers path I think you also need Adminhtml – Robin Nov 3 '15 at 9:52
  • But there is no adminhtml.xml? Would it matter? I'm not good in extensions – Zinat Nov 3 '15 at 9:53
3

You action should be

  • adminhtml/sales_paymentmethod/YourActionName

from

  • adminhtml/g_sales_paymentmethod

Rules:

adminRouterName/Lowecase(ClassNameFromAdminhtmlFolderTOController)/ActionName

Update

Your controller path should be

../J/G/controllers/Adminhtml/Sales/PaymentmethodController.php 

Class should name should be

  • J_G_Adminhtml_Sales_PaymentmethodController
  • Almost there...I created the Adminhtml folder in controllers and put the subfolders in it.From where I should get the "ActionName"? I got this error "Controller file was loaded but class does not exist" – Zinat Nov 3 '15 at 10:37
  • please check update – Amit Bera Nov 3 '15 at 10:42
0
<routers>
        <adminhtml>
            <args>
                <modules>
                    <G before="Mage_Adminhtml">J_G_Adminhtml</G>
                </modules> 
            </args> 
        </adminhtml> 
    </routers>` 

I think?

  • It did not work for me! How about the action? – Zinat Nov 3 '15 at 9:56
  • I would take a look at here github.com/rhoerr/supee-6788-toolbox , see how he fixes extensions and copy that method – Robin Nov 3 '15 at 10:26
  • I have done that but it did not help, as it does not create Adminhtml folder if needed – Zinat Nov 3 '15 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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