Vinai / groupscatalog2

Magento extension to enable you to hide categories and products from customers depending on their customer group. This is a Magento 1.6 and newer compatible version of the Netzarbeiter Customer Groups Catalog extension.
139 stars 60 forks source link

Not Working with Vinai/VinaiKopp_ProductCategories #96

Closed netorica closed 10 years ago

netorica commented 10 years ago

I am currently working with magento 1.9 and I am trying to make Vinai/groupscatalog2 work with Vinai/VinaiKopp_ProductCategories but as Vinai/groupscatalog2 takes over the category level collection it seems to create error. Error occurs upon calling getItemById() on stack 11 its on file app/code/community/VinaiKopp/ProductCategories/Block/CategoryList.php line 165

a:5:{i:0;s:101:"SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'entity_id' in where clause is ambiguous";i:1;s:5567:"#0 C:\xampp\htdocs\mymagento\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 C:\xampp\htdocs\mymagento\app\code\core\Zend\Db\Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 C:\xampp\htdocs\mymagento\lib\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 C:\xampp\htdocs\mymagento\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 C:\xampp\htdocs\mymagento\lib\Varien\Db\Adapter\Pdo\Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 C:\xampp\htdocs\mymagento\lib\Zend\Db\Adapter\Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#6 C:\xampp\htdocs\mymagento\lib\Varien\Data\Collection\Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#7 C:\xampp\htdocs\mymagento\app\code\core\Mage\Core\Model\Resource\Db\Collection\Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#8 C:\xampp\htdocs\mymagento\lib\Varien\Data\Collection\Db.php(566): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 C:\xampp\htdocs\mymagento\lib\Varien\Data\Collection.php(729): Varien_Data_Collection_Db->load()
#10 C:\xampp\htdocs\mymagento\app\code\community\VinaiKopp\ProductCategories\Block\CategoryList.php(165): Varien_Data_Collection->getItemById('1')
#11 C:\xampp\htdocs\mymagento\app\code\community\VinaiKopp\ProductCategories\Block\CategoryList.php(193): VinaiKopp_ProductCategories_Block_CategoryList->getParentCategoriesForCategory(Object(Mage_Catalog_Model_Category))
#12 [internal function]: VinaiKopp_ProductCategories_Block_CategoryList->_sortByParentBaseCategory(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category))
#13 C:\xampp\htdocs\mymagento\app\code\community\VinaiKopp\ProductCategories\Block\CategoryList.php(110): usort(Array, Array)
#14 C:\xampp\htdocs\mymagento\app\design\frontend\base\default\template\vinaikopp\productcategories\list.phtml(24): VinaiK

Im currently using flat tables is it causes the error? I already tried to turn off the use of flat tables seems to have the same error for me. re-indexing properly works and seems no problem in the tables.

regards very awesome extension =)

Vinai commented 10 years ago

Thats interesting... just did a quick test on 1.9 and all works fine with both the GroupsCatalog2 and ProductCategories extensions installed. Will need to try a bit longer and see if I can reproduce the issue.

Vinai commented 10 years ago

Okay, managed to reproduce. Hope to have a fix ready soon, like, tomorrow.

Vinai commented 10 years ago

Just pushed an update - please try the latest HEAD and let me know if that fixes your problem. Thanks!

Vinai commented 10 years ago

Ups, I should say I've pushed the update to the VinaiKopp_ProductCategories extension.

netorica commented 10 years ago

Now works great! thanks Vinai! =)