Question

My custom module is generating this error on the system log everytime I try to view the indexController.

2012-01-25T17:23:08+00:00 CRIT (2): Not valid template file:adminhtml/base/default/template/page/2columns-right.phtml

I've been fishing through my module code for hours, just can't seem to find anything wrong. What could cause this? The base/default folder doesn't even exist under adminhtml.

Was it helpful?

Solution

The "base/default" package/theme is the final folder Magento will look for template files in. When you see this error, it means Magento looked for the template in

[current-design-package]/current-theme/template/page/2columns-right.phtml
[current-design-package]/default/template/page/2columns-right.phtml

There's not enough information in your question to 'suss out the exact problem you're having, but it looks like you have, by your self or via a third-party-module, made an attempt to change the template of the root block (or perhaps another block) in the Magento admin console application to 2columns-right.phtml.

However, this template does not exists anywhere in the adminhtml design package. That's why you're getting that error. There's only one root template that ships with the admin console, and that's page.phtml. The 2columns-right.phtml template is a frontend template, for the cart application.

If that doesn't help a better description of your module, as well as your motivation for using it and what you expect to happen will be needed for anyone to answer your question.

OTHER TIPS

Some where you set this template to display, but this template can't be included. Check next place to understand possible issue:

app/code/core/Mage/Core/Block/Template.php

public function fetchView($fileName)
try {
    $includeFilePath = realpath($this->_viewDir . DS . $fileName);
    if (strpos($includeFilePath, realpath($this->_viewDir)) === 0) {
        include $includeFilePath;
    } else {
        Mage::log('Not valid template file:'.$fileName, Zend_Log::CRIT, null, null, true);
    }
}

Check which path used for include this file. Check permissions for such file etc. Hope it helps.

I don't know about earlier versions, but in 1.8 there is no "base" package for adminhtml. There is a "default" package, with inside the "default" theme.

It is recommended to create a new theme, and not a new package, for overriding the default theme. Reason is that if you make your own package, the fallback mechanism will try to find files it misses in your package in the "base" package (which doesn't exist for adminhtml). By creating a theme in the default package, the fallback mechanism can use the default theme for finding files.

And then, there is what Alan Storm told you about not having this page template for the backend, only frontend :) But whether it exists or not, make sure you're not making your own fallback mechanism (or .. create the base package and copy the default package into it :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top