Missing column in database?
Gravatar
Joined: 2019-01-10
Posts: 4
Hi,

It seems I have a very similar problem to the one described in this forum topic (https://ebizmarts.com/forums/topics/view/27958/) but I would like to confirm the solution before going ahead with it.

The problem seems to be a missing column in our database. It seems to be a field called "mailchimp_synced_flag". The solution given in the topic I mentioned above was to recreate this column via an "ALTER TABLE sales_flat_order ADD COLUMN" command. First, is this the solution for my case? If so, could you send me the exact command that I should run to create this column? Thank you, Daniel PS Below is the error: **********ERROR START********** a:5:{i:0;s:487:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'mc.mailchimp_synced_flag' in 'field list', query was: SELECT `main_table`.*, `order`.`canal`, `order`.`canal_id`, `mc`.`mailchimp_synced_flag`, `mc`.`id` FROM `sales_flat_order_grid` AS `main_table` INNER JOIN `sales_flat_order` AS `order` ON order.entity_id = main_table.entity_id LEFT JOIN `mailchimp_ecommerce_sync_data` AS `mc` ON mc.related_id=main_table.entity_id AND type = 'ORD' GROUP BY `main_table`.`entity_id` LIMIT 20";i:1;s:5711:"#0 /var/www/html/quartinhos.com.br/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) #1 /var/www/html/quartinhos.com.br/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array) #2 /var/www/html/quartinhos.com.br/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #3 /var/www/html/quartinhos.com.br/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array) #4 /var/www/html/quartinhos.com.br/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array) #5 /var/www/html/quartinhos.com.br/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array) #6 /var/www/html/quartinhos.com.br/lib/Varien/Data/Collection/Db.php(740): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array) #7 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array) #8 /var/www/html/quartinhos.com.br/lib/Varien/Data/Collection/Db.php(572): Mage_Core_Model_Resource_Db_Collection_Abstract->getData() #9 /var/www/html/quartinhos.com.br/app/code/community/Thirdlevel/Pluggto/Block/Order/Grid.php(52): Varien_Data_Collection_Db->load() #10 /var/www/html/quartinhos.com.br/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(643): Thirdlevel_Pluggto_Block_Order_Grid->_prepareCollection() #11 /var/www/html/quartinhos.com.br/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(649): Mage_Adminhtml_Block_Widget_Grid->_prepareGrid() #12 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Block/Abstract.php(922): Mage_Adminhtml_Block_Widget_Grid->_beforeToHtml() #13 /var/www/html/quartinhos.com.br/app/code/local/Moogento/Core/Block/Adminhtml/Sales/Order/Grid.php(132): Mage_Core_Block_Abstract->toHtml() #14 /var/www/html/quartinhos.com.br/app/code/local/Moogento/Core/Block/Adminhtml/Sales/Order/Grid.php(104): Moogento_Core_Block_Adminhtml_Sales_Order_Grid->_getInitialGrid() #15 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Block/Abstract.php(297): Moogento_Core_Block_Adminhtml_Sales_Order_Grid->_prepareLayout() #16 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Smartwave_All_Model_Core_Layout)) #17 /var/www/html/quartinhos.com.br/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(66): Mage_Core_Model_Layout->createBlock('moogento_core/a...', 'adminhtml_sales...') #18 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Block/Abstract.php(297): Mage_Adminhtml_Block_Widget_Grid_Container->_prepareLayout() #19 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Smartwave_All_Model_Core_Layout)) #20 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/sales...', 'sales_order.gri...') #21 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/sales...', 'sales_order.gri...') #22 /var/www/html/quartinhos.com.br/app/code/local/Smartwave/All/Model/Core/Layout.php(40): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element)) #23 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Model/Layout.php(205): Smartwave_All_Model_Core_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element)) #24 /var/www/html/quartinhos.com.br/app/code/local/Smartwave/All/Model/Core/Layout.php(31): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) #25 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Model/Layout.php(210): Smartwave_All_Model_Core_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) #26 /var/www/html/quartinhos.com.br/app/code/local/Smartwave/All/Model/Core/Layout.php(31): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) #27 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Smartwave_All_Model_Core_Layout->generateBlocks() #28 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks() #29 /var/www/html/quartinhos.com.br/app/code/core/Mage/Adminhtml/Controller/Action.php(285): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true) #30 /var/www/html/quartinhos.com.br/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(59): Mage_Adminhtml_Controller_Action->loadLayout() #31 /var/www/html/quartinhos.com.br/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(94): Mage_Adminhtml_Sales_OrderController->_initAction() #32 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_OrderController->indexAction() #33 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index') #34 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #35 /var/www/html/quartinhos.com.br/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch() #36 /var/www/html/quartinhos.com.br/app/Mage.php(692): Mage_Core_Model_App->run(Array) #37 /var/www/html/quartinhos.com.br/index.php(83): Mage::run('', 'store') #38 {main}";s:3:"url";s:75:"/index.php/controle/sales_order/index/key/e039f9426290937354e3977b25a7219a/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}
Gravatar
Joined: 2018-08-14
Posts: 235
Hi Daniel,

Thanks for contacting us.

Can you tell me your current mailchimp and magento version numbers?
Can you tell me when/where you see this error?
Gravatar
Joined: 2019-01-10
Posts: 4
Magento 1.9.3.9 and MailChimp 1.1.13
Gravatar
Joined: 2019-01-10
Posts: 4
BTW, I had downloaded 1.1.12 but when this error started happening, MailChimp support asked me to install 1.1.13 from github. I did that and the error still remains.
Gravatar
Joined: 2018-08-14
Posts: 235
Hi Daniel,

Can you tell me when/where you see this error?
Gravatar
Joined: 2019-01-10
Posts: 4
That error showed in the logs when I go to the view orders page while having the Mailchimp extension enabled. If I disable it, all goes back to normal.
Gravatar
Joined: 2018-08-14
Posts: 235
Hi,

Looks like the extension was not installed correctly. Can you let me know which method did you use for installation step by step?
That way I might see which step is the one that failed.

One possible solution might be restarting the database scripts. This should happen after the following steps:
1. Run the following query in the database console: DELETE FROM core_resource WHERE code = 'mailchimp_setup';
2. Refresh Magento's cache.

NEWSLETTER

Subscribe to our newsletter to receive emails and useful news articles