OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
870 stars 436 forks source link

Deleting Attribute Set products deleted #4360

Open TangLiang opened 5 hours ago

TangLiang commented 5 hours ago

Steps to reproduce (*)

1.Make a new attribute set 2.Assign attribute set to product 3.delete attribute set

Actual result (*)

The product gets deleted from the DB and everywhere.

justinbeaty commented 3 hours ago

The admin panel should give a warning about this, no?

https://github.com/OpenMage/magento-lts/blob/7806f0e529da17a85df6f82c09420116a1a60f26/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php#L95-L105

Would it be better to not allow deletion of the attribute set if products are assigned to it? Or require the user to type something like “confirm deletion” into a box to proceed? Or maybe disable the affected products?

I believe it’s this way because I’m not sure reassigning the product to the default attribute set is possible since there could be required fields present in the default set that weren’t in the deleted set.

TangLiang commented 57 minutes ago

i think it's much better to reassign the product to default with basic attributes