2012-01-09 114 views
2

我开发的一个magento扩展有一个很大的问题。本地一切都很好,但是当我部署时,它会得到这个错误。Magento上的错误标签配置

错误选项卡配置

#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

希望你能帮助

+0

如果有人可以指出我在一个可能的错误方向,这将是伟大的。 – MathiasH 2012-01-09 17:06:37

+0

btw,localhost正在运行一个更新的版本1.5.1.0 – MathiasH 2012-01-09 17:06:59

+0

什么是错误信息本身? – 2012-01-09 17:44:12

回答

10

,如果你停止搜索谷歌并开始搜索你的代码你会得到很多更远。

的异常字符串“错卡的配置”

$ 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.')); 

看那个

搜索的话,只有2点在整个源代码树可能的位置可能被抛出该异常,无论在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,用于从当前选项卡

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

但是,它看起来像什么发现在那里取一个孩子块不是Mage_Adminhtml_Block_Widget_Tab_Interface一个孩子。

我的猜测是因为getChild的调用返回false,因为你的模块没有在布局中添加名称为tab_pricematrix的选项卡(是否将布局XML文件复制到新服务器?已经实现了这个模块,这是不可能的。

祝你好运!

+1

我正在删除不再处于扩展名的文件使用和这个答案帮助了我。我做了一个
'grep -rin“tab_pricematrix”*'并找到了违规文件。 (我的功能不叫做tab_pricematrix)事实证明,开发人员编写了自定义覆盖来解除扩展依赖关系,当未使用的包被删除时它们被破坏。 – 2014-09-19 19:37:05

2

正常情况下,不在活动网站上出现的localhost问题与文件系统区分大小写有关。根据我的经验,大多数开发人员都是在Windows/Mac OSX上开发的,默认情况下不区分大小写。但大多数生产环境都是某种* nix系统。过去有一件事情让我感到沮丧,那就是中间有一个大写字母的文件名。

例如,如果一个块是FooBar.php和Mage_Core坐镇,装载必须使用

Mage::getModel('core/fooBar'); 

的字符串会自动通过ucwords跑在模型......,但很明显,任何骆驼套管时您文件命名将需要考虑到当请求一个模型/块等

+0

这是你在你的例子中有一个小f的错字吗? – MathiasH 2012-01-10 09:11:27

+1

不,路径get在下划线上爆炸,并跑过ucwords,这意味着f会自动变为大写。如果该类名为Foo_Bar,并且名为Bar.php的文件位于Foo文件夹中,则可以简单地使用'core/foo_bar'。 – 2012-01-10 09:55:11