gpt4 book ai didi

magento-1.5 - Magento 上的选项卡配置错误

转载 作者:行者123 更新时间:2023-12-01 14:04:52 26 4
gpt4 key购买 nike

我开发的 magento 扩展有一个大问题。 Localhost 一切正常,但是当我部署时,出现此错误。

选项卡配置错误

#0 [internal function]: Mage_Adminhtml_Block_Widget_Tabs->addTab('pricematrix', 'tab_pricematrix')
#1 /var/www/vhosts/discountprint.dk/httpdocs/app/code/core/Mage/Core/Model/Layout.php(347): call_user_func_array(Array, Array)
#2 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Core/Model/Layout.php(213): Mage_Core_Model_Layout->_generateAction(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#3 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Core/Model/Layout.php(209): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#4 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(343): Mage_Core_Model_Layout->generateBlocks()
#5 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(270): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#6 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Adminhtml/Controller/Action.php(263): Mage_Core_Controller_Varien_Action->loadLayout(Array, true, true)
#7 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(246): Mage_Adminhtml_Controller_Action->loadLayout(Array)
#8 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->editAction()
#9 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch('edit')
#10 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /var/www/vhosts/something.dk/httpdocs/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
#12 /var/www/vhosts/something.dk/httpdocs/app/Mage.php(627): Mage_Core_Model_App->run(Array)
#13 /var/www/vhosts/something.dk/httpdocs/index.php(80): Mage::run('', 'store')
#14 {main}

我用 Google 搜索了几个小时,但找不到任何有用的信息。我的 magento 版本是 1.5.0.1

希望能帮到你

最佳答案

如果您停止搜索 Google 并开始搜索您的代码,您会走得更远。

搜索异常字符串“Wrong tab configuration”

$ ack 'Wrong tab configuration'
Adminhtml/Block/Widget/Tabs.php
108: throw new Exception(Mage::helper('adminhtml')->__('Wrong tab configuration.'));
112: throw new Exception(Mage::helper('adminhtml')->__('Wrong tab configuration.'));

看看那个,整个源代码树中只有 两个 可能的地方可能会抛出该异常,这两个地方都在您的堆栈跟踪指示的 addTab 方法中叫。在上下文中查看该代码

public function addTab($tabId, $tab)
{
if (is_array($tab)) {
$this->_tabs[$tabId] = new Varien_Object($tab);
}
elseif ($tab instanceof Varien_Object) {
$this->_tabs[$tabId] = $tab;
if (!$this->_tabs[$tabId]->hasTabId()) {
$this->_tabs[$tabId]->setTabId($tabId);
}
}
elseif (is_string($tab)) {
if (strpos($tab, '/')) {
$this->_tabs[$tabId] = $this->getLayout()->createBlock($tab);
}
elseif ($this->getChild($tab)) {
$this->_tabs[$tabId] = $this->getChild($tab);
}
else {
$this->_tabs[$tabId] = null;
}

if (!($this->_tabs[$tabId] instanceof Mage_Adminhtml_Block_Widget_Tab_Interface)) {
throw new Exception(Mage::helper('adminhtml')->__('Wrong tab configuration.'));
}
}
else {
throw new Exception(Mage::helper('adminhtml')->__('Wrong tab configuration.'));
}

看起来您的调用正在通过第二个 if/else 分支运行。您的选项卡字符串 tab_pricematrix 用于从当前选项卡中获取子 block

$this->_tabs[$tabId] = $this->getChild($tab);

但是,看起来它在那里找到的任何东西都不是 Mage_Adminhtml_Block_Widget_Tab_Interface 的子级。

我的猜测是因为调用 getChild 返回 false,因为您的模块没有将名称为 tab_pricematrix 的选项卡添加到布局中(您是否复制了将 XML 文件布局到新服务器?)不知道您是如何实现该模块的,因此无法确定。

祝你好运!

关于magento-1.5 - Magento 上的选项卡配置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8792049/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com