hotcakes-commerce-core icon indicating copy to clipboard operation
hotcakes-commerce-core copied to clipboard

CI: Data inconsistency when deleting Product Type Property Value

Open coretoco opened this issue 7 years ago • 1 comments

Describe the bug

When a Product Type Property Value is deleted, there is no reference check if this value is currently assigned to a product. After the value is deleted the category viewer is throwing an error whenever this product would be displayed.

Software Versions

  • DNN: 08.00.04
  • Hotcakes: 03.02.01

To Reproduce

Steps to reproduce the behavior:

  1. Create a Product Type Property 'Age'
  2. Add two Property Type Specific Settings '3+' and '8+'
  3. Create a Product Type 'Toy' and add Product Type Property 'Age'
  4. Create a product of type 'Toy' and select Age '8+' and save product
  5. Delete Property Type Specific Value '8+'

Expected behavior

A message should be displayed that this setting is in use and cannot be deleted.

Actual behavior

The setting is deleted, and the reference to the ID remains in the database. If you go to a page where CategoryViewer Module is installed and set to drilldown an error is shown

Error log

errorlog.txt

Additional context

Table [hcc_ProductPropertyValue] still contains a record for the deleted [hcc_ProductPropertyChoice]

coretoco avatar Nov 22 '18 10:11 coretoco

I like your suggestion for the expected behavior. I'm hoping we can get this into an upcoming release very soon.

WillStrohl avatar Dec 19 '18 19:12 WillStrohl