Simple example tested on magento

Created overloaded controller for Mage_Cms_IndexController

    <My_Extension before="Mage_Cms">My_Extension</My_Extension>

In my controller I have two methods

testOneAction and testTwoAction

I can confirm that they work my just going into /cms/index/testOne and /cms/index/testTwo

Now the fun part

Created third method

public function testThirdAction() {

When compiler is DISABLED going into /cms/index/testThird I can see data from testOne

When compiler is ENABLED - got blank page

Even with display_errors, developer mode, full error reporting, there is absolutely nothing in magento logs, web server logs or php error logs.

Tried xdebug and it pointed me into direction that request is not marked as dispatched and then it dies silently.

What I found so far: In includes/src/Varien_Autoload.php

 * Register autoload scope
 * This process allow include scope file which can contain classes
 * definition which are used for this scope
 * @param string $code scope code
static public function registerScope($code)
    self::$_scope = $code;
    if (defined('COMPILER_INCLUDE_PATH')) {

Looks like @ makes it to die silently, if I change it to include_once, everything works great

Anyone can help?

1 Answer 1


This is a bug which is related with magento compiler. I will give you a short glance of what is actually happens here.

During compilation enabled, magento uses a copy of every files inside the directory include/src. Since every file have a corresponding copy in single directory and magento uses this single directory while coimpilation enabled, magento performs faster.

When you do $this->_forward('testOne'), magento now process router match processing one more time. As module didnt change, Mage_Core_Controller_Varien_Action::preDispatch method intents to make Varien_Autoload to load the the include/src/Mage_Cms_IndexController.php again. This is what failing here. Why it fails ? You have found out the answer. It is the bug which is present in includes\src\Varien_Autoload::registerScope()

static public function registerScope($code)
    self::$_scope = $code;
    if (defined('COMPILER_INCLUDE_PATH')) {
      // Change to include_once to prevent including multiple times !!!

The last line of code is failing in this particular case. This is because, magento is trying to load the same Mage_Cms_IndexController which is avialble in includes/src when you perform a _forward action.

So if you use include_once instead of include, then it will resolve the issue.

For more info, use this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.