Magento: Adminhtml Template Fallback Bug

I discovered an interesting bug with the adminhtml templates today. When we deployed a site to the server, while trying to not deploy the media/ directory, we also left out the app/design/adminhtml/default/default/template/media/ directory.

First sign that something was wrong was when I went into the backend and tried to edit a product. Magento threw an error saying that it couldn’t find app/design/adminhtml/base/default/template/media/uploader.phmtl. As you can see, Magento is looking for the file as though it is a frontend template. The ‘base’ package does not exist for adminhtml.

Instead of being smart and checking to see if the uploader.phtml file was where it should be, we dug into trying to find why Magento was looking for the file in base/default instead of default/default. Finally we decided to take a look at the template file and discovered that the media folder didn’t even exist on the server.

After putting the files up on the server, it worked fine. But, the interesting thing to note is that if Magento cannot find an adminhtml file, it will fall back looking for it in app/design/adminhtml/base/default/. That shouldn’t happen with adminhtml templates.

This entry was posted in Magento. Bookmark the permalink.

One Response to Magento: Adminhtml Template Fallback Bug

  1. Pingback: Magento: Adminhtml Template Fallback Bug

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">