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.

2 Responses to Magento: Adminhtml Template Fallback Bug

  1. Muhammad says:

    THanks man , this error causing making new product and cannot able to edit the product
    here is the explaination
    go to

    and fine “media” folder

    if its not there then copy full folder and paste in there

    full “media ” folder file from the installation file or any other instalation according to version

    cheers :)

  2. Pingback: Magento: Adminhtml Template Fallback Bug