5

Explanation

So I have a module, I'll call it Hello_World with the following code in config.xml

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Hello_World before="Mage_Adminhtml">Hello_World_Adminhtml</Hello_World>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Under the controllers/Adminhtml folder I have two controllers which DO NOT EXTEND any core Magento controllers.

On the other hand, I have another module called Bye_World with the same code in config.xml:

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Bye_World before="Mage_Adminhtml">Bye_World_Adminhtml</Bye_World>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Under the controllers/Adminhtml folder I have one controller which DOES EXTEND a core Magento controller

Problem

If I try to make Bye_World depending on Hello_World by adding the following to my app/etc/modules/Bye_World.xml :

<depends>
    <Hello_World />
</depends>

Then my Bye_World adminhtml controller core rewrite won't be called anymore even though there's no Hello_World adminhtml controller that rewrites the same core controller.

So I'm wondering what I'm doing wrong ?

  • 1
    What if you add before="Hello_World" in your xml? – David Manners Apr 13 '17 at 8:52
  • @DavidManners hmmm that did it. Feel free to post that as an answer however I'm not sure why I need to do that as there's no controller conflicts between both modules ? That kinda confuses me – Raphael at Digital Pianism Apr 13 '17 at 8:54
5

So as far as I understand it you will need to update your module's config xml to also include the adminhtml dependency. To do this you should include the following in your Bye_World config.

before="Hello_World"

The reason for this is....

  • That sounds like a good reason xD – Raphael at Digital Pianism Apr 13 '17 at 9:01
  • 1
    hahaha @RaphaelatDigitalPianism I was looking into this and then got distracted by a customer. – David Manners Apr 13 '17 at 9:06

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.