Problems Overriding Magento Community Module Controller

前端 未结 2 1938
执笔经年
执笔经年 2021-01-17 04:48

First of all, the Answer here is very helpful: Overriding a Magento Controller in community extention

However, despite passing both of the \"tests\" mentioned in the

2条回答
  •  [愿得一人]
    2021-01-17 05:03

    Your best bet is to drop some debugging code into the standard router (temporarily, of course).

    #File: app/code/core/Mage/Core/Controller/Varien/Router/Standard.php
    protected function _validateControllerClassName($realModule, $controller)
    {
        $controllerFileName = $this->getControllerFileName($realModule, $controller);
        if (!$this->validateControllerFileName($controllerFileName)) {
            return false;
        }
    
        $controllerClassName = $this->getControllerClassName($realModule, $controller);
        if (!$controllerClassName) {
            return false;
        }
    
        // include controller file if needed
        if (!$this->_includeControllerClass($controllerFileName, $controllerClassName)) {
            return false;
        }
    
        return $controllerClassName;
    }
    

    Each return false is an instance where the router considers a configured controller and rejects it based on an improper name, not being able to find or include the file, etc.

提交回复
热议问题