0

I am struggling with weird problem when go to admin and click for add new rule code or edit a previously created shopping cart price rule en error is coming out

a:5:{i:0;s:29:"Test Wrong tab configuration.";i:1;s:2443:"#0 [internal function]: Mage_Adminhtml_Block_Widget_Tabs->addTab('coupons_section', 'promo_quote_edi...')
#1 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Core/Model/Layout.php(347): call_user_func_array(Array, Array)
#2 /var/www/vhosts/beadsofcambay.com/magento/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/beadsofcambay.com/magento/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#4 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Core/Model/Layout.php(209): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#5 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(345): Mage_Core_Model_Layout->generateBlocks()
#6 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(270): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#7 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Adminhtml/Controller/Action.php(263): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#8 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php(43): Mage_Adminhtml_Controller_Action->loadLayout()
#9 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php(92): Mage_Adminhtml_Promo_QuoteController->_initAction()
#10 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_Promo_QuoteController->editAction()
#11 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#12 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/vhosts/beadsofcambay.com/magento/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/vhosts/beadsofcambay.com/magento/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#15 /var/www/vhosts/beadsofcambay.com/magento/index.php(87): Mage::run('', 'store')
#16 {main}";s:3:"url";s:70:"/index.php/admin/promo_quote/new/key/accf713773b40d7a8531a365ea28cabe/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

I have looked into the app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php

under the function addTab($tabId, $tab)

This condition is giving error where $tabId is coupon_section

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

It was previously running perfect but don't know why this is giving error now?

1 Answer 1

1

First of all check if the class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons implements Mage_Adminhtml_Block_Widget_Tab_Interface. In the core code it does. Maybe someone modified it.

Second: Did you install any extensions related to discount rules? Maybe there is an extension that overrides Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons or that adds a block to this page with the same name (promo_quote_edit_tab_coupons).

Third: You can add this code before the exception is thrown and see what class is the tab.

if(!($this->_tabs[$tabId] instanceof Mage_Adminhtml_Block_Widget_Tab_Interface)){
     echo 'Wrong tab class is:'.get_class($this->_tabs[$tabId]);exit;//add this line
     throw new Exception(Mage::helper('adminhtml')->__('Test Wrong tab configuration.'));
}

Instead of getting the error you should see the class of the tab and get an idea on what is wrong.

3
  • Thanks a lot Marius.. it really help me i tried searching the class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons but wasn't present so i created the file Coupons.php and worked.
    – Ravi Soni
    Mar 20, 2013 at 11:20
  • This is really strange. You said that it worked some time ago, but just stopped working. If there is something that deleted the file there is a chance that there are other missing files. I recommend checking your files against a clean Magento instance. At least the ones in app/code/core
    – Marius
    Mar 20, 2013 at 12:04
  • Yes i had check this in fresh installation but i didn't find the file there i am on 1.6.2 version but i tried your solution and tested it, it working just fine.
    – Ravi Soni
    Mar 20, 2013 at 12:18

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.