Opened 7 years ago
Closed 7 years ago
#42593 closed defect (bug) (worksforme)
Wordpress 4.9 upgrade deleting values from Woocommerce variations
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9 |
Component: | Database | Keywords: | |
Focuses: | Cc: |
Description
I just upgraded a site using Woocommerce to 4.9. The upgrade process deleted the attribute key and value for the variation attribute, but only if they used double quotes (or so it seems). For example, I have a WC variable product with about 10 variations for photography. The variation values are things like Metal Print 8" x 10", Metal Print 11" x 14", etc. I also have variable products that have variation values such as small, medium, and large. The variation names that had double quotes in them were removed (e.g., Metal Print 8" x 10"), but the variation names that didn't have double quotes did not get deleted (e.g., Small). The rest of the variation data seems to be there, but I haven't checked to see if there was anything else that had a double quote that got clobbered. I had to restore my site from backup to reclaim the lost data.
Attachments (2)
Change History (6)
#1
@
7 years ago
Confirmed that the issue occurs using the TwentySeventeen theme. I've attached two snips showing the Variations before and after the update.
#2
@
7 years ago
Another clue. The variations that are losing their association to the specific attribute have a slash (/) in their name. That is, the name of the custom attribute is "Available Styles/Sizes". All products variations that use this custom attribute have "Any available Style..." after the update. I copied one of these products, created an identical custom attribute except I named it "Available Styles and Sizes" and did the update again. The product with the custom attribute "Available Styles and Sizes" was unaffected. The product variations with the slash in their custom attribute name lost their assigned attribute again.
#3
@
7 years ago
I'm able to reproduce this and have created an issue in WooCommerce: https://github.com/woocommerce/woocommerce/issues/17775
Most likely the behavior of a sanitize function or something changed slightly and we need to update WooCommerce to account for this change. I'll follow up here if it turns out the issue is caused by a bug in WP.
Snip of variations pre-update