Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

2 modules which overload the same controller
 
ekinos31
Jr. Member
 
Total Posts:  1
Joined:  2009-08-13
 

Hello

I have 2 modules which overload the same controller “Checkout/CartControlleur” and they have the same router “/chekout/cart/” redefine into the config.xml
When magento search the right module to call, it take the last and troubles begin smile

I can extends the first with the second and unactive the router of the first module in the config.xml, but i don’t like this because it’s not my module and i don’t want modify the code.

Does anyone have a solution?
Can i solve my problème with a proxy/router ?

Thanks

Ekinos

 
Magento Community Magento Community
Magento Community
Magento Community
 
magedev
Sr. Member
 
Avatar
Total Posts:  117
Joined:  2009-06-01
 

You can use as many controllers using the same route as you’d like to, just see http://www.magentocommerce.com/boards/viewthread/34256/#t161413

 
Magento Community Magento Community
Magento Community
Magento Community
 
LindyKyaw
Sr. Member
 
Avatar
Total Posts:  138
Joined:  2008-01-02
Los Angeles
 

You can use <depends> dependency of the module.

For example:

<Myproject_Test>
            <
active>true</active>
            <
codePool>local</codePool>
        </
Myproject_Test>
        <
Myproject_Second>
            <
active>true</active>
            <
codePool>local</codePool>
            <
depends>
                <
Mage_Test/>
            </
depends>
        </
Myproject_Second>

If there is a dependency of the module, Magento will load the dependent module first.
By doing as above, the configuration in Myproject_Second will overwrite the configuration in MyProject_Test.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zshanthi
Member
 
Total Posts:  56
Joined:  2009-07-17
 

Suppose if the dependency module is not found will Magento continue loading the new module without the dependent module ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
magedev
Sr. Member
 
Avatar
Total Posts:  117
Joined:  2009-06-01
 

Thankfully in this case Magento will throw exception…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top