1

Issue: When I create a grouped product with a couple of simple products and attempt to view the group on the front end of site I get an error log.

a:5:{i:0;s:588:"SELECT `e`.*, `at_status`.`value` AS `status`, `links`.`link_id` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '96') AND (`at_status`.`store_id` = 0)
 INNER JOIN `catalog_product_link` AS `links` ON links.linked_product_id = e.entity_id AND links.link_type_id = 3 WHERE (((`e`.`required_options` != '1') OR (`e`.`required_options` IS NULL))) AND (at_status.value IN(1, 2)) AND (links.product_id = 1863) AND (`e`.`entity_id` != '1863') ORDER BY `position` ASC

";i:1;s:5105:"#0 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `e`.*, `...', Array)
#4 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `e`.*, `...', Array)
#5 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `e`.*, `...', Array)
#6 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECT `e`.*, `...', Array)
#7 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1047): Varien_Data_Collection_Db->_fetchAll('SELECT `e`.*, `...')
#8 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(871): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false)
#9 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Varien/Data/Collection.php(741): Mage_Eav_Model_Entity_Collection_Abstract->load()
#10 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php(140): Varien_Data_Collection->getIterator()
#11 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php(209): Mage_Catalog_Model_Product_Type_Grouped->getAssociatedProducts(Object(Mage_Catalog_Model_Product))
#12 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php(128): Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group->getSelectedGroupedProducts()
#13 [internal function]: Mage_Adminhtml_Block_Widget_Grid_Serializer->initSerializerBlock('catalog.product...', 'getSelectedGrou...', 'links[grouped]', 'products_groupe...')
#14 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Model/Layout.php(348): call_user_func_array(Array, Array)
#15 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Model/Layout.php(214): Mage_Core_Model_Layout->_generateAction(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#16 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#17 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#18 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Model/Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#19 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#20 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#21 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#22 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(413): Mage_Adminhtml_Controller_Action->loadLayout()
#23 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_Catalog_ProductController->superGroupAction()
#24 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('superGroup')
#25 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#26 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#27 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#28 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/index.php(87): Mage::run('', 'store')
#29 {main}";s:3:"url";s:162:"/dev/index.php/admin/catalog_product/superGroup/id/1863/back/edit/tab/product_info_tabs_super/set/4/type/grouped/key/14fc486890c32a1d7d914c007cd81099/?isAjax=true";s:11:"script_name";s:14:"/dev/index.php";s:4:"skin";s:5:"admin";}

Also this error

a:5:{i:0;s:1032:"SELECT `e`.*, IF(at_status.value_id > 0, at_status.value, at_status_default.value) AS `status`, `links`.`link_id` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = '1'
 INNER JOIN `catalog_product_entity_int` AS `at_status_default` ON (`at_status_default`.`entity_id` = `e`.`entity_id`) AND (`at_status_default`.`attribute_id` = '96') AND `at_status_default`.`store_id` = 0
 LEFT JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '96') AND (`at_status`.`store_id` = 1)
 INNER JOIN `catalog_product_link` AS `links` ON links.linked_product_id = e.entity_id AND links.link_type_id = 3 WHERE (((`e`.`required_options` != '1') OR (`e`.`required_options` IS NULL))) AND (IF(at_status.value_id > 0, at_status.value, at_status_default.value) IN(1)) AND (links.product_id = 1863) AND (`e`.`entity_id` != '1863') ORDER BY `position` ASC

";i:1;s:7148:"#0 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `e`.*, I...', Array)
#4 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `e`.*, I...', Array)
#5 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `e`.*, I...', Array)
#6 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECT `e`.*, I...', Array)
#7 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1047): Varien_Data_Collection_Db->_fetchAll('SELECT `e`.*, I...')
#8 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(871): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false)
#9 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/lib/Varien/Data/Collection.php(741): Mage_Eav_Model_Entity_Collection_Abstract->load()
#10 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php(140): Varien_Data_Collection->getIterator()
#11 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php(40): Mage_Catalog_Model_Product_Type_Grouped->getAssociatedProducts(Object(Mage_Catalog_Model_Product))
#12 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/design/frontend/base/default/template/catalog/product/view/type/grouped.phtml(36): Mage_Catalog_Block_Product_View_Type_Grouped->getAssociatedProducts()
#13 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(241): include('/nfs/c03/h01/mn...')
#14 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#15 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#16 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#17 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#18 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('product_type_da...', true)
#19 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/design/frontend/default/f002/template/catalog/product/view.phtml(63): Mage_Core_Block_Abstract->getChildHtml('product_type_da...')
#20 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(241): include('/nfs/c03/h01/mn...')
#21 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#22 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#23 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#24 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#25 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#26 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#27 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#28 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/design/frontend/default/f002/template/page/2columns-right.phtml(48): Mage_Core_Block_Abstract->getChildHtml('content')
#29 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(241): include('/nfs/c03/h01/mn...')
#30 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#31 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#32 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#33 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#34 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#35 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Catalog/Helper/Product/View.php(147): Mage_Core_Controller_Varien_Action->renderLayout()
#36 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(1863, Object(Mage_Catalog_ProductController), Object(Varien_Object))
#37 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Catalog_ProductController->viewAction()
#38 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#39 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#40 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#41 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#42 /nfs/c03/h01/mnt/82242/domains/mysite.com/html/dev/index.php(87): Mage::run('', 'store')
#43 {main}";s:3:"url";s:47:"/dev/index.php/magnets/guitar-magnets/test.html";s:11:"script_name";s:14:"/dev/index.php";s:4:"skin";s:7:"default";}

Then if I attempt to edit the group product it will not allow me to select the Associated Products tab. I'm not adding any special attributes so I'm stuck on how to fix this error. Can anyone point me in the right direction?

6
  • Do you have a module that extends any of the product-related models? The column position is causing the error because it doesn't exist.
    – laketuna
    Commented May 8, 2014 at 21:00
  • Correct, (ORDER BY position ASC) possition doesn't exsist on catalog_product_entity, catalog_product_entity_int or catalog_product_link. But when assigning the simple products to the group you can assign position.
    – Stephen
    Commented May 8, 2014 at 21:53
  • I disabled the extension and cleared cache and re-indexed but the problem still persist. Odd as this only happens with groups. All other products open and behave fine...
    – Stephen
    Commented May 8, 2014 at 22:41
  • What's the extension, and did you disable the extension by putting false in its app/etc/modules/xyz.xml?
    – laketuna
    Commented May 9, 2014 at 2:21
  • The extension is "XTENTO Order Export." I disabled it both internally and by changing etc/modules > <>False</>. I have two copies of this site. One copy is the Dev site located on a Media Temple Server (the one not working). The second on my laptop with wamp5 server which is working. So I decided to try and upload the app folder to the Dev server from my laptop to see if that would fix the issue, but it did not. The only difference besides environment is that on the dev server I have about 1800 products that I uploaded via the system import/export Dataflow profiles and more categories.
    – Stephen
    Commented May 9, 2014 at 16:24

2 Answers 2

2

This was a database issue. This happens when you are missing foreign keys in your database. I had improperly migrated my database to exclude or ignor foreign keys and this was the result.

The solution was to use the original database before the migration. Then migrate the data for each table.

//When migrating the data from SQL, place this statement at the top:

SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0; 

And this statement below it.

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
SET SQL_NOTES=@OLD_SQL_NOTES;
0

It seems your reference entries are missing. you need to enter below data in reference tables.

INSERT  INTO `catalog_category_entity`(`entity_id`,`entity_type_id`,`attribute_set_id`,`parent_id`,`created_at`,`updated_at`,`path`,`POSITION`,`level`,`children_count`) VALUES (1,3,0,0,'0000-00-00 00:00:00','2009-02-20 00:25:34','1',1,0,1),(2,3,3,0,'2009-02-20 00:25:34','2009-02-20 00:25:34','1/2',1,1,0);
INSERT  INTO `catalog_category_entity_int`(`value_id`,`entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value`) VALUES (1,3,32,0,2,1),(2,3,32,1,2,1);
INSERT  INTO `catalog_category_entity_varchar`(`value_id`,`entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value`) VALUES (1,3,31,0,1,'Root Catalog'),(2,3,33,0,1,'root-catalog'),(3,3,31,0,2,'Default Category'),(4,3,39,0,2,'PRODUCTS'),(5,3,33,0,2,'default-category');

You can refer below link as well..

Clearing Magento after testing

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.