Giter VIP home page Giter VIP logo

Comments (9)

Vinai avatar Vinai commented on June 12, 2024

Thanks for your notice. Which version of Magento and the extension are you using?

from groupscatalog2.

bdgeorge avatar bdgeorge commented on June 12, 2024

Magento 1.6.2 with 0.2.7

from groupscatalog2.

bdgeorge avatar bdgeorge commented on June 12, 2024

For my next test I've removed the deleted store entries from core_store and core_store_group - deleting a store from the UI doesn't remove these and other indexing issues arise with these still in place, no change I'm afraid!

from groupscatalog2.

Vinai avatar Vinai commented on June 12, 2024

Somethings wrong with your DB I'm afraid, because the core_store table has a on delete cascade constraint to the the core_website table

So what should happen is:

  1. you delete a website via the backend UI
  2. the record for that website is removed from the core_website table
  3. that cascades to core_store (and core_store_group, too, by the way)
  4. that in turn also cascade deletes all affected records from the groupscatalog tables (and many other core tables, too)

Please check the tables in question use the InnoDB engine and the foreign keys are set up correctly.

from groupscatalog2.

bdgeorge avatar bdgeorge commented on June 12, 2024

Interesting, I'll double check - the number of people with similar errors (separate to GroupsCatalog) and the message from the delete action made me think that it didn't delete this stuff:
Deleting a %1$s will not delete the information associated with the %1$s (e.g. categories, products, etc.), but the %1$s will not be able to be restored. It is suggested that you create a database backup before deleting the %1$s.
(Mage_Adminhtml_System_StoreController)

Also if I create a new website and then delete it straight away without adding anything into it remains in the core_store* tables.

Let me try on a completely fresh instance!

from groupscatalog2.

Vinai avatar Vinai commented on June 12, 2024

When I do a SHOW CREATE TABLE core_store I get the following table description:

CREATE TABLE `core_store` (
  `store_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Store Id',
  `code` varchar(32) DEFAULT NULL COMMENT 'Code',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website Id',
  `group_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Group Id',
  `name` varchar(255) NOT NULL COMMENT 'Store Name',
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Sort Order',
  `is_active` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Activity',
  PRIMARY KEY (`store_id`),
  UNIQUE KEY `UNQ_CORE_STORE_CODE` (`code`),
  KEY `IDX_CORE_STORE_WEBSITE_ID` (`website_id`),
  KEY `IDX_CORE_STORE_IS_ACTIVE_SORT_ORDER` (`is_active`,`sort_order`),
  KEY `IDX_CORE_STORE_GROUP_ID` (`group_id`),
  CONSTRAINT `FK_CORE_STORE_GROUP_ID_CORE_STORE_GROUP_GROUP_ID` FOREIGN KEY (`group_id`) REFERENCES `core_store_group` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_CORE_STORE_WEBSITE_ID_CORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='Stores'

Also I just tested it, when I delete a record from core_website, the corresponding core_store entry is removed, as well as any records referencing it from for example the catalog_product_entity_int table (which also uses a on delete cascade foreign key on core_store.store_id

To be honest, I don't know what that warning message refers to - it might be obsolete.

from groupscatalog2.

bdgeorge avatar bdgeorge commented on June 12, 2024

Hmm, I'm missing those constraints, this store started life as 1.3.2.4 with MyISAM tables (Innodb not supported at that time on that hosting company).

Since then I've switched to InnoDB using the Magento DB repair tool and then upgraded it from 1.3 -> 1.6.

Looking through the mysql-upgrades I think the first place those constraints are rebuilt is only at the mysql4-upgrade-1.5.9.9-1.6.0.0.php script, but for some reason they weren't.

So somehow I got unlucky and missed those constraints being added either by the repair tool or by the store upgrade (!) and that must be a big part of the problem, if it missed them what else did it miss....

I'll try the DB repair tool again and come back to this ticket once I've retested - were you able to reindex correctly after a store deletion?

from groupscatalog2.

Vinai avatar Vinai commented on June 12, 2024

No problem reindexing after deleting a website or a store view.

from groupscatalog2.

bdgeorge avatar bdgeorge commented on June 12, 2024

I'm going to put this down to a large and slightly corrupted database then, thanks heaps for looking into it and being so quick to respond, much appreciated!

from groupscatalog2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.