Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

error in CMS > Widgets
 
mcongosto
Member
 
Total Posts:  41
Joined:  2010-02-15
 

Hello

In admin when i try to go cms > widget i get this error:

SQLSTATE[42S02]Base table or view not found1146 Table 'crcs.widget_instance' doesn't exist

Trace:
#0 /home/costaricacoffeeshop/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/costaricacoffeeshop/public_html/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /home/costaricacoffeeshop/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('
SELECT COUNT(*)...', Array)
#3 /home/costaricacoffeeshop/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('
SELECT COUNT(*)...', Array)
#4 /home/costaricacoffeeshop/public_html/lib/Zend/Db/Adapter/Abstract.php(799): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#5 /home/costaricacoffeeshop/public_html/lib/Varien/Data/Collection/Db.php(210): Zend_Db_Adapter_Abstract->fetchOne(Object(Varien_Db_Select), Array)
#6 /home/costaricacoffeeshop/public_html/lib/Varien/Data/Collection.php(188): Varien_Data_Collection_Db->getSize()
#7 /home/costaricacoffeeshop/public_html/lib/Varien/Data/Collection.php(174): Varien_Data_Collection->getLastPageNumber()
#8 /home/costaricacoffeeshop/public_html/lib/Varien/Data/Collection/Db.php(545): Varien_Data_Collection->getCurPage()
#9 /home/costaricacoffeeshop/public_html/lib/Varien/Data/Collection/Db.php(575): Varien_Data_Collection_Db->_renderLimit()
#10 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php(195): Varien_Data_Collection_Db->load(false, false)
#11 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(484): Mage_Core_Model_Mysql4_Collection_Abstract->load()
#12 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php(58): Mage_Adminhtml_Block_Widget_Grid->_prepareCollection()
#13 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(576): Mage_Widget_Block_Adminhtml_Widget_Instance_Grid->_prepareCollection()
#14 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(582): Mage_Adminhtml_Block_Widget_Grid->_prepareGrid()
#15 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Abstract.php(673): Mage_Adminhtml_Block_Widget_Grid->_beforeToHtml()
#16 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Abstract.php(516): Mage_Core_Block_Abstract->toHtml()
#17 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Abstract.php(467): Mage_Core_Block_Abstract->_getChildHtml('
grid', true)
#18 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(70): Mage_Core_Block_Abstract->getChildHtml('
grid')
#19 /home/costaricacoffeeshop/public_html/app/design/adminhtml/default/default/template/widget/grid/container.phtml(36): Mage_Adminhtml_Block_Widget_Grid_Container->getGridHtml()
#20 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Template.php(189): include('
/home/costarica...')
#21 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Template.php(225): Mage_Core_Block_Template->fetchView('
adminhtml/defau...')
#22 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Template.php(242): Mage_Core_Block_Template->renderView()
#23 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#24 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Container.php(295): Mage_Adminhtml_Block_Template->_toHtml()
#25 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Abstract.php(674): Mage_Adminhtml_Block_Widget_Container->_toHtml()
#26 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#27 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Abstract.php(674): Mage_Core_Block_Text_List->_toHtml()
#28 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Abstract.php(516): Mage_Core_Block_Abstract->toHtml()
#29 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Abstract.php(467): Mage_Core_Block_Abstract->_getChildHtml('
content', true)
#30 /home/costaricacoffeeshop/public_html/app/design/adminhtml/default/default/template/page.phtml(74): Mage_Core_Block_Abstract->getChildHtml('
content')
#31 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Template.php(189): include('
/home/costarica...')
#32 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Template.php(225): Mage_Core_Block_Template->fetchView('
adminhtml/defau...')
#33 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Template.php(242): Mage_Core_Block_Template->renderView()
#34 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#35 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Block/Abstract.php(674): Mage_Adminhtml_Block_Template->_toHtml()
#36 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Model/Layout.php(536): Mage_Core_Block_Abstract->toHtml()
#37 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(389): Mage_Core_Model_Layout->getOutput()
#38 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php(100): Mage_Core_Controller_Varien_Action->renderLayout()
#39 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Widget_Adminhtml_Widget_InstanceController->indexAction()
#40 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('
index')
#41 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#42 /home/costaricacoffeeshop/public_html/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#43 /home/costaricacoffeeshop/public_html/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#44 /home/costaricacoffeeshop/public_html/index.php(86): Mage::run('', '
store')
#45 {main}

Please help, thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
mcongosto
Member
 
Total Posts:  41
Joined:  2010-02-15
 

I know several people in this forum are having this issue, could someone please give me a hint where to start debugging this? It started after upgrading to 1.4.0.1.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 

I submitted a bug report a few days ago.  I actually created the same thread here as well.

Magento responded that it was due to an incomplete upgrade.  They advised to do a clean install to a separate directory, and then copy tables over to current installation.

I personally, think something is wrong with the current version if this is happening to multiple users, or we all some common server setting that messes things up.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageNewbie
Jr. Member
 
Total Posts:  7
Joined:  2009-12-10
 

Same here. Missing widget_instance table.

Installed Magento 1.3.2.4, then 2 upgrades; to 1.4.0.0 and 1.4.0.1

Local installation on WAMPserver.

When trying to open the CMS > Widgets menu I get the following error message:
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘magento.widget_instance’ doesn’t exist

Can anyone help us with this?

SQL for creating the missing table perhaps?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageNewbie
Jr. Member
 
Total Posts:  7
Joined:  2009-12-10
 

OK I found a (temporary) solution. Find the file Magento uses to install the widgets in:

app/code/core/Mage/Widget/sql/widget-setup/

copy the CREATE TABLE codes and remove the PHP parts that look like this:

CREATE TABLE IF NOT EXISTS `{$installer->getTable('widget/widget_instance')}` (

resulting in:

CREATE TABLE IF NOT EXISTS `widget_instance` (

I alse needed to remove this last part in order for the SQL to create the last table:

CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_IDFOREIGN KEY (`layout_update_id`) REFERENCES `{$installer->getTable('core/layout_update')}` (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE,
    
CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_PAGE_IDFOREIGN KEY (`page_id`) REFERENCES `{$installer->getTable('widget/widget_instance_page')}` (`page_id`) ON DELETE CASCADE ON UPDATE CASCADE

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 

Can you please specify more clearly what you did?  Did you run this as sql or php?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageNewbie
Jr. Member
 
Total Posts:  7
Joined:  2009-12-10
 

Run it as SQL in i.e. PHPmyAdmin

 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 

So you ran the last two commands you listed in PHPmyAdmin?

And everything is working as it should? 

Thanks for info so far.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageNewbie
Jr. Member
 
Total Posts:  7
Joined:  2009-12-10
 

No, run the entire code from the install script, stripped from any php. And whthout the last part.

CREATE TABLE IF NOT EXISTS `widget` (
  `
widget_idINT(10UNSIGNED NOT NULL AUTO_INCREMENT,
  `
codeVARCHAR(255NOT NULL,
  `
typeVARCHAR(255NOT NULL,
  `
parameterstext,
  
PRIMARY KEY  (`widget_id`),
  
KEY `IDX_CODE` (`code`)
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Preconfigured Widgets';

CREATE TABLE IF NOT EXISTS `widget_instance` (
  `
instance_idINT(11UNSIGNED NOT NULL AUTO_INCREMENT,
  `
typeVARCHAR(255NOT NULL DEFAULT '',
  `
package_themeVARCHAR(255NOT NULL DEFAULT '',
  `
titleVARCHAR(255NOT NULL DEFAULT '',
  `
store_idsVARCHAR(255NOT NULL DEFAULT '0',
  `
widget_parametersTEXT,
  `
sort_orderSMALLINT(5NOT NULL DEFAULT '0',
  
PRIMARY KEY (`instance_id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `widget_instance_page` (
  `
page_idINT(11UNSIGNED NOT NULL AUTO_INCREMENT,
  `
instance_idINT(11UNSIGNED NOT NULL DEFAULT '0',
  `
groupVARCHAR(25NOT NULL DEFAULT '',
  `
layout_handleVARCHAR(255NOT NULL DEFAULT '',
  `
block_referenceVARCHAR(255NOT NULL DEFAULT '',
  `
forVARCHAR(25NOT NULL DEFAULT '',
  `
entitiesTEXT,
  `
templateVARCHAR(255NOT NULL DEFAULT '',
  
PRIMARY KEY (`page_id`),
  
KEY `IDX_WIDGET_WIDGET_INSTANCE_ID` (`instance_id`),
  
CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_IDFOREIGN KEY (`instance_id`) REFERENCES `widget_instance` (`instance_id`) ON DELETE CASCADE ON UPDATE CASCADE
ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `widget_instance_page_layout` (
    `
page_idint(11UNSIGNED NOT NULL DEFAULT '0',
    `
layout_update_idint(10UNSIGNED NOT NULL DEFAULT '0',
    
UNIQUE KEY `page_id` (`page_id`,`layout_update_id`),
    
KEY `IDX_WIDGET_WIDGET_INSTANCE_PAGE_ID` (`page_id`),
    
KEY `IDX_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID` (`layout_update_id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 

Got it, thanks!  Will try it out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mcongosto
Member
 
Total Posts:  41
Joined:  2010-02-15
 
MageNewbie - 26 March 2010 04:55 AM

No, run the entire code from the install script, stripped from any php. And whthout the last part.

worked perfectly, thank you very much

 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 

This worked for me too.  I ran the query, but had to rename all my tables, because all my tables have prefixes.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ladle
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-06-11
 

This solution is actually not really completely working for me.

I am getting errors when trying to save certain kind of widgets, like Twitter for example.

A problem with Invalid argument in Model/Widget/Instance.php around line 468

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top