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

installation problem (Integrity constraint violation: 1062 Duplicate entry) #100

Closed vincenthfrance closed 9 years ago

vincenthfrance commented 10 years ago

Hello

I have a problem to install this extension

/var/report/ a:5:{i:0;s:302:"Error in file: "/home/luxeotw/public_html/app/code/community/Netzarbeiter/GroupsCatalog2/sql/netzarbeiter_groupscatalog2_setup/install-0.2.9.php" - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '22-General' for key 'UNQ_EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME'";i:1;s:956:"#0 /home/luxeotw/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')

Do you know how to fix it?

Best regards Vincent

Vinai commented 10 years ago

I think this must mean that you already had the module installed previously. Please run the following SQL, clear the config cache and try again:

  DELETE FROM `eav_attribute` WHERE attribute_code = 'groupscatalog2_groups';
  DELETE FROM `core_resource` WHERE code = 'netzarbeiter_groupscatalog2_setup';
  DELETE FROM `index_process` WHERE indexer_code = 'groupscatalog2_product';
  DELETE FROM `index_process` WHERE indexer_code = 'groupscatalog2_category';
  DROP TABLE IF EXISTS `groupscatalog_product_idx`;
  DROP TABLE IF EXISTS `groupscatalog_category_idx`;
vincenthfrance commented 10 years ago

Thanks for reply.

I have run SQL command and clear cache but same problem.

groupscatalog_product_idx and groupscatalog_category_idx are missing.

And DELETE FROM core_resource WHERE code = 'netzarbeiter_groupscatalog2_setup'; return 0 row

Vincent

Vinai commented 10 years ago

Okay, the problem is that the script is trying to recreate the General attribute group for a set. I don't know what the problem is. Have you changed the name or somehow else edited the General attribute group of a attribute set?

vincenthfrance commented 10 years ago

I have set active=false in Netzarbeiter_GroupsCatalog2.xml to desactivate but i have this error: "Invalid backend model specified: netzarbeiter_groupscatalog2/entity_attribute_backend_customergroups" when i want go to manage category

I have change name of root category

I have imported product from old magento where groupcatalog are installed and after i install groupcatalog on new magento

(sorry for my bad english)

Vinai commented 10 years ago

If you deactivate the module, the attribute backend models are still referenced from the database. You need to delete the eav_attribute record, too, if you want to deactivate the extension.

The name change of the root category is of no concern. The error you posted refers to a product attribute group. I have to say, I don't know what is causing the error. It has never before been reported, and I have never seen it happen either.

vincenthfrance commented 10 years ago

thanks for reply

I'll look more closely product attribute group and clean database

when i imported product by magmi dump perharps attribute group are broken

Vinai commented 10 years ago

That might be the case. I know that other forms of imports via magmi are used together with this extension, but I don't know if from a magmi dump.

vincenthfrance commented 9 years ago

Hello

I have set module in app/etc/module to false excute sql DELETE FROM eav_attribute WHERE attribute_code = 'groupscatalog2_groups'; DELETE FROM core_resource WHERE code = 'netzarbeiter_groupscatalog2_setup'; DELETE FROM index_process WHERE indexer_code = 'groupscatalog2_product'; DELETE FROM index_process WHERE indexer_code = 'groupscatalog2_category'; DROP TABLE IF EXISTS groupscatalog_product_idx; DROP TABLE IF EXISTS groupscatalog_category_idx;

repair database (see: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/db-repair-tool )

and reinstall module

thanks for this great module