0

Magento 1.4

当客户尝试打印订单时,错误:

Invalid method Mage_Page_Block_Html::addAttribute(Array
(
    [0] => meta_description
)
)

被抛出。

以及完整的堆栈跟踪:

#0 [internal function]: Varien_Object->__call('addAttribute', Array)
#1 /chroot/home/shopz/shopz.co.uk/html/app/code/core/Mage/Core/Model/Layout.php(347): Mage_Page_Block_Html->addAttribute('meta_descriptio...')
#2 /chroot/home/shopz/shopz.co.uk/html/app/code/core/Mage/Core/Model/Layout.php(213): Mage_Core_Model_Layout->_generateAction(Array, Array)
#3 /chroot/home/shopz/shopz.co.uk/html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#4 /chroot/home/shopz/shopz.co.uk/html/app/code/core/Mage/Core/Controller/Varien/Action.php(343): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#5 /chroot/home/shopz/shopz.co.uk/html/app/code/core/Mage/Core/Controller/Varien/Action.php(270): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#6 /chroot/home/shopz/shopz.co.uk/html/app/code/local/Mage/Sales/controllers/OrderController.php(237): Mage_Core_Controller_Varien_Action->loadLayout()
#7 /chroot/home/shopz/shopz.co.uk/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Sales_OrderController->printAction('print')
#8 /chroot/home/shopz/shopz.co.uk/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch()
#9 /chroot/home//shopz/shopz.co.uk/html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match('print')
#10 /chroot/home//shopz/shopz.co.uk/html/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch(Object(Mage_Core_Controller_Request_Http))
#11 /chroot/home//shopz/shopz.co.ukhtml/app/Mage.php(596): Mage_Core_Model_App->run()
#12 /chroot/home//shopz/shopz.co.uk/html/index.php(80): Mage::run(Array)

翻阅' /app/code/core/Mage/Core/Model/Layout.php'看来该块对销售发票无效。模板文件中的一切似乎都很好。

4

1 回答 1

0

如果有任何对 addAttribute 方法的引用,最好检查 page.xml 文件。它可能看起来像:

<action method="addAttribute" ...

删除不必要的电话应该会有所帮助。

于 2013-02-19T12:42:48.833 回答