Risolto: Se l'estensione non ha una cartella adminhtml.xml e adminhtml, come risolvere 404?
-
13-12-2019 - |
Domanda
Dopo aver applicato la patch 6788, so che Config.xml deve essere modificato.La mia estensione non ha la cartella AdminHTML e il suo file XML, quindi dopo aver effettuato le modifiche, sto ancora ottenendo 404. Di seguito è riportato il config.xml.Quale sarebbe la dichiarazione "azione" corretta?
<?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>....
. Soluzione
L'azione dovrebbe essere
- .
-
adminhtml/sales_paymentmethod/YourActionName
DA
- .
-
adminhtml/g_sales_paymentmethod
Regole:
adminroutertername / lowecase (classnamofromadminhtmlwardertocontroller) / actionname
AGGIORNAMENTO
Il percorso del controller dovrebbe essere
../J/G/controllers/Adminhtml/Sales/PaymentmethodController.php
.
La classe dovrebbe nominare dovrebbe essere
- .
-
J_G_Adminhtml_Sales_PaymentmethodController
Altri suggerimenti
<routers>
<adminhtml>
<args>
<modules>
<G before="Mage_Adminhtml">J_G_Adminhtml</G>
</modules>
</args>
</adminhtml>
</routers>`
.
Penso?
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange