1

Can't for the life of me get my store to work with the custompackage/customtheme I created in this tutorial: http://www.magentocommerce.com/knowledge-base/entry/ee114-ce19-rwd-dev-guide

I SSH'd into my server that has a brand new install of Magento 1.9.1, then used the exact commands given in the tutorial to create the new directories and copy the files over from the rwd theme. After that, I downloaded the new /scss directory onto my Windows machine and used Scout to generate the css files, and then uploaded those to my server at /skin/frontend/custompackage/customtheme/css.

As soon as I update the System->Configuration->General->Design->Package and Theme settings in Magento to custompackage and customtheme, I get the "There has been an error processing your request" Magento error page when I try to load my home page.

Anyone have any idea what sort of mistake I could have made to cause that error?

Thanks!

Edit- Here is the exception and backtrace generated by Magento:

a:5:{i:0;s:24:"Not valid template file:";i:1;s:4309:"  
0 /public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Page_Block_Html_Topmenu_Renderer->_toHtml()  
1 /public_html/app/code/core/Mage/Page/Block/Html/Topmenu.php(81): Mage_Core_Block_Abstract->toHtml()  
2 /public_html/app/design/frontend/base/default/template/page/html/topmenu.phtml(34): Mage_Page_Block_Html_Topmenu->getHtml('level-top')  
3 /public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/*/...')  
4 /public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')  
5 /public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()  
6 /public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()  
7 /public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()  
8 /public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()  
9 /public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()  
10 /public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('topMenu', true)  
11 /public_html/app/design/frontend/base/default/template/page/html/header.phtml(46): Mage_Core_Block_Abstract->getChildHtml('topMenu')  
12 /public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/*/...')  
13 /public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')  
14 /public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()  
15 /public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()  
16 /public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()  
17 /public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('header', true)  
18 /public_html/app/design/frontend/base/default/template/page/2columns-right.phtml(42): Mage_Core_Block_Abstract->getChildHtml('header')  
19 /public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/*/...')  
20 /public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')  
21 /public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()  
22 /public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()  
23 /public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()  
24 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()  
25 /public_html/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()  
26 /public_html/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')  
27 /public_html/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')  
28 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()  
29 /public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')  
30 /public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))  
31 /public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()  
32 /public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)  
33 /public_html/index.php(87): Mage::run('', 'store')  
34 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Here are the templates that I got when I made this call:

grep -E '(catalog/navigation|page/html/topmenu)' app/design/frontend/*/*/layout/*.xml

template="page/html/topmenu/renderer.phtml"
template="catalog/navigation/left.phtml"
template="page/html/topmenu.phtml"
template="catalog/navigation/top.phtml"

When I call

find app/design/frontend -path '*/template/path/to/template.html'

with those paths, I am able to find each of the templates referenced. They all exist in /frontend/rwd, except "top.phtml" which is only in /frontend/base and /frontend/default.

Why would this error exist once I switch to custompackage and customtheme, but not exist when I have package and theme both set to rwd? My /frontend/custompackage directory only contains /customtheme/etc/theme.xml which, as per the tutorial, reads as follows:

<?xml version="1.0"?>  
<theme>  
<parent>rwd/default</parent> 
</theme>
2
  • That page generates a report in var/report. It contains the exception and backtrace.
    – user4351
    Commented Dec 9, 2014 at 7:59
  • Thanks - I added the report to the question. From it I understand that customtheme isn't a valid theme, but I don't understand why.
    – Jim
    Commented Dec 9, 2014 at 18:53

3 Answers 3

1

That error means you are missing the template file for the category menu. Your theme defines a template for it, but it's not installed.

To find out which template it's looking for, you can try:

grep -E '(catalog/navigation|page/html/topmenu)' app/design/frontend/*/*/layout/*.xml

Look for template="path/to/template.phtml" in the output and try to locate each file using:

find app/design/frontend -path '*/template/path/to/template.html'

This is the non invasive way. If that yields no results, you will need to insert a debug statement into the core file app/code/core/Mage/Page/Html/Topmenu/Renderer.php. The exception is really there, not sure why the backtrace in the report is incomplete. Starting from line 52, insert two debug statements:

    $includeFilePath = realpath(Mage::getBaseDir('design') . DS . $this->getTemplateFile());
    Mage::log('Resolving template '.$includeFilePath, null, 'template.log', true); // Debug line 1
    if (strpos($includeFilePath, realpath(Mage::getBaseDir('design'))) === 0 || $this->_getAllowSymlinks()) {
        $this->_templateFile = $includeFilePath;
    } else {
        Mage::log('Design base dir not at start but at index: ', strpos($includeFilePath, realpath(Mage::getBaseDir('design'))), null, 'template.log', true); // Debug line two
        throw new Exception('Not valid template file:' . $this->_templateFile);
    }

This will create a file template.log in the var/log directory. From the looks of it, there are symlinks involved or at least the checks here assume that based on the strpos() outcome. Very interesting to see the results.

Ok, you accepted the answer so you found the error. In my stock 1.9.0.1 install there's ./app/design/frontend/rwd/default/template/page/html/topmenu/renderer.phtml. For some reason your theme.xml is not respected. Cache can be an issue here. But with the information provided in the question, it seems you did everything right :).

10
  • Thank you for your help. I've added the paths/files that get returned by those calls to my original post. I'll try adding that debug line now, but I would think whatever mistake I made in following the tutorial would result in something very fundamentally wrong with my package/theme structure.
    – Jim
    Commented Dec 9, 2014 at 20:45
  • 1
    Well, the top.phtml is your problem. You're setting the parent to rwd/default, so top.phtml has to exist either in custompackage/customtheme or rwd/default. Allthough I would expect it to still fallback to base/default, it seems it doesn't. Verify with the debug code and then look in app/design/frontend/custompackage/customtheme/layout/*.xml where that file is referenced.
    – user4351
    Commented Dec 9, 2014 at 21:09
  • The tutorial didn't call for a customtheme/layout/ directory. The only file in app/design/frontend/custompackage/custometheme/ is /etc/theme.xml. The tutorial I'm referencing is here: magentocommerce.com/knowledge-base/entry/…
    – Jim
    Commented Dec 9, 2014 at 21:23
  • I'm not able to get the path with a debug function. The function that line 919 of Abstract.php is in is called toHtml(). As best I can tell it doesn't reference the path of a template. The only variables set before line 919 are $html and $translate. Let me know if you want me to put the function in my main post.
    – Jim
    Commented Dec 9, 2014 at 22:21
  • Answer updated.
    – user4351
    Commented Dec 9, 2014 at 23:40
0

I still don't know exactly went wrong with using Scout to compile the css, but when I tried the same tutorial on a dedicated server with Compass/Sass installed and used the watch command everything worked as it was supposed to.

0

I noticed a line in the stack trace of the error that mentions Layout.php line 555. Please check out one of my answered questions about this line. Just in case, because it can solve your problem immediately. The answers is in the PHP 7 to PHP 5 compatibility with uniform variable syntax. See https://www.atwix.com/magento/magento-and-php-7/ and https://wiki.php.net/rfc/uniform_variable_syntax .

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.