I’m in the same boat. A victim of another extension pulling in the 1.3.0 update, which is not Lee’s fault, but I’m eager to see an update as some crucial components of our site depend upon Modular Routers.
Has anyone found a viable workaround or anything in 1.3.0 that would support custom controllers or overrides similarly?
I’m in the same boat. A victim of another extension pulling in the 1.3.0 update, which is not Lee’s fault, but I’m eager to see an update as some crucial components of our site depend upon Modular Routers.
Has anyone found a viable workaround or anything in 1.3.0 that would support custom controllers or overrides similarly?
include_once("Mage/Customer/controllers/AccountController.php"); class MyCompany_MyModule_AccountController extends Mage_Customer_AccountController { public function loginAction() { // Do Something parent::loginAction(); } }
For anyone that doesn’t know already. LKC_ModularRouters does not work with 1.3 due to a change in the core routers that Varien implemented. They added the ability for a single ‘frontname’ to be used by multiple modules via the XML config files. They did not address the namespacing issues are anything else, but you now have the ability to override core controllers. If you override a core controller and do not extend the underlying core module, it will try to load the action from your controller and then fail through to the normal core controller.
To recap:
LKC_ModularRouters is currently not 1.3 compatible
Varien added the ability for a single ‘frontname’ to resolve to multiple modules
You can define order on stacked modules via ‘before’ and ‘after’ attributes that contain module names (like Mage_Customer or Mage_Adminhtml)
You can either extend the controller you are overriding, or just implement a controller/action from scratch and allow other actions to pass over to the underlying controller
My module will really only provide namespacing and an alternative override ability starting with the 1.3 compatable version.
They sort of work for me. We have 1 “from scratch” action and this method supports its call. However, there’s now a bug in it that I fear is due to something that’s just....missing in the request. I’m baffled. Everything should be there, but an underlying function is failing. (This action allows us to add multiple products to cart based on a querystring of SKUs/quantities).
For the two existing controller actions we overrode (ProductController and CategoryController) I cannot get the controllers to fire. I gave up on these and hacked our overrides into the core code. Is that “parent::...” required? Do the modules need to be referenced in their own app/etc/modules? Or can they be referenced in MyCompany_All?
include_once("Mage/Customer/controllers/AccountController.php"); class MyCompany_MyModule_AccountController extends Mage_Customer_AccountController { public function loginAction() { // Do Something parent::loginAction(); } }
I’m struggling to get a Module going that overrides the AdminHtml_controllers_Sales_OrderController.php
Using Lee’s suggested setup as well as trying many other variations, this is what I have so far, that doesn’t work:
The Module shows in the admin as enabled yet my test when submitting an order comment doesn’t work. Edit the core controller and it does. So somehow, somewhere, it’s not picking up on this class extension / controller override. Any hints?