升级到1.7之后(感谢所有在开发服务器上!)我收到客户端自定义主题的以下错误日志:
a:5:{i:0;s:93:"Invalid method Mage_Catalog_Block_Navigation::renderCategoriesAndChildrenMenuHtml(Array
(
)
)";i:1;s:3806:"#0 /var/www/vhosts/mydomain.co.uk/httpdocs/app/design/frontend/p365_mydomain/default/template/catalog/navigation/left.phtml(17): Varien_Object->__call('renderCategorie...', Array)
#1 /var/www/vhosts/mydomain.co.uk/httpdocs/app/design/frontend/p365_mydomain/default/template/catalog/navigation/left.phtml(17): Mage_Catalog_Block_Navigation->renderCategoriesAndChildrenMenuHtml()
#2 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#3 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/p365_s...')
#4 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#5 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#6 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#7 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#8 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#9 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('left', true)
#10 /var/www/vhosts/mydomain.co.uk/httpdocs/app/design/frontend/p365_mydomain/default/template/page/2columns-left.phtml(34): Mage_Core_Block_Abstract->getChildHtml('left')
#11 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#12 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/p365_s...')
#13 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#15 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#16 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#17 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#18 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#19 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#20 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Cms_IndexController->indexAction()
#21 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#22 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#23 /var/www/vhosts/mydomain.co.uk/httpdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#24 /var/www/vhosts/mydomain.co.uk/httpdocs/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#25 /var/www/vhosts/mydomain.co.uk/httpdocs/index.php(87): Mage::run('', 'store')
#26 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:22:"mydomain_store_view";}
主题在1.5安装上工作正常,但由于主题是由其他人制作的(并且他们安装了旧版本,我无法确定他们没有修改任何核心代码等
谷歌搜索找到“无效方法Mage_Catalog_Block_Navigation :: renderCategoriesMenuHtml”但不是“renderCategoriesAndChildrenMenuHtml”的结果。我认为它可能是一个自定义函数,但我在核心代码中找到了它。完全被这个难倒!
答案 0 :(得分:2)
Magento 1.5.0.0的默认主题调用renderCategoriesMenuHtml
,块仅包含函数renderCategoriesMenuHtml
。在您的情况下,或者有人更正了核心文件,或者是重写Mage_Catalog_Block_Navigation
的模块。
一种可能的解决方案是将文件renderCategoriesAndChildrenMenuHtml
中的renderCategoriesMenuHtml
替换为app/design/frontend/p365_mydomain/default/template/catalog/navigation/left.phtml
,或使用默认模板进行导航/左侧使用代码:
<?php if (!Mage::registry('current_category')) return ?>
<?php $_categories = $this->getCurrentChildCategories() ?>
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?>
<?php if($_count): ?>
<div class="block block-layered-nav">
<div class="block-title">
<strong><span><?php echo $this->__('Browse By') ?></span></strong>
</div>
<div class="block-content">
<dl id="narrow-by-list2">
<dt><?php echo $this->__('Category') ?></dt>
<dd>
<ol>
<?php foreach ($_categories as $_category): ?>
<?php if($_category->getIsActive()): ?>
<li>
<a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_category->getName()) ?></a> (<?php echo $_category->getProductCount() ?>)
</li>
<?php endif; ?>
<?php endforeach ?>
</ol>
</dd>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list2')</script>
</div>
</div>
<?php endif; ?>