CI: Data inconsistency when deleting Product Type Property Value
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:
- Create a Product Type Property 'Age'
- Add two Property Type Specific Settings '3+' and '8+'
- Create a Product Type 'Toy' and add Product Type Property 'Age'
- Create a product of type 'Toy' and select Age '8+' and save product
- 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
Additional context
Table [hcc_ProductPropertyValue] still contains a record for the deleted [hcc_ProductPropertyChoice]
I like your suggestion for the expected behavior. I'm hoping we can get this into an upcoming release very soon.