1

Since a couple of days I´m looking at the behaviour of the Magento backend. To comprehend I made a new grid to see a table of the bbdd. After finishing this grid I can see that I have a 404 error when try I to add a widget in a CMS page:

enter image description here

Debugging I can see that the error disappears if I comment this out of my custom module

<admin>
    <routers>
       <giftrouter>
            <use>admin</use>
            <args>
                <module>Wpr_Giftproducts_Adminhtml</module>
                <frontName>admin</frontName>
                <modules>
                    <sintax after="Wpr_Giftproducts_Adminhtml">Mage_Adminhtml</sintax>
                </modules>
            </args>
       </giftrouter>             

     </routers>     
</admin>

Concretely I think that the error was caused by this:

<sintax after="Wpr_Giftproducts_Adminhtml">Mage_Adminhtml</sintax>

But I don´t understand how this config works. How can I set a custom route to avoid conflict with the widget?

Junuxx
  • 14,011
  • 5
  • 41
  • 71
davidselo
  • 1,326
  • 2
  • 19
  • 34

1 Answers1

5

I think you have your routers in reverse.

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <sintax before="Mage_Adminhtml">Wpr_Giftproducts_Adminhtml</sintax>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

This way the Giftproducts controller is part of the adminhtml router, whereas the old way was reassigning admin controllers to giftrouter.

clockworkgeek
  • 37,650
  • 9
  • 89
  • 127
  • you don´t put frontname. why not?? what is the diference??. i don´t how to work this, and the unique knowledge is for example that i find in internet. if i put Wpr_Giftproducts_Adminhtml the backend stops working. – davidselo Mar 02 '12 at 23:18
  • Only one router can have the front name of `admin`, and that is already used by `adminhtml`. Your router was `giftrouter` but here I have dropped that whole thing. Delete the entire `` section. – clockworkgeek Mar 02 '12 at 23:33