Closed tess0072 closed 5 years ago
Yes, I can replicate that issue. I think, this issue happens because WooCommerce may uses the WordPress function update_metadata() while duplicating a product. update_metadata() applies wp_unslash(). wp_unslash() removes the slashes of the preserved double-quotes characters of JSON content strings. For example {"key":"citation:\"Hello World!\""} ends up {"key":"citation:"Hello World!""} That kills the JSON string. That was an issue on ACF itself on restoring posts from a revision. The fix is very easy by using wp_slash() before update_metadata(). I will contact WooCommerce about this. I can´t do anything else.
I submitted a ticket to WooCommerce.
Thank you for looking into this.
I´ve got the advise from the WooCommerce customer support to submit that issue at the WooCommerce Github repository:
The issue will be fixed in WooCommerce version 3.1.0.
We have observed an issue with the plugin not working properly when duplicating WooCommerce products. To reproduce the issue, create a table field group and associate it to your WooCommerce Product post type. When duplicating the WooCommerce Product you will see that the table field group generates a JSON parse error.
I have narrowed the issue down to the double-quotes character (") if the table data contains double quotes it will not duplicate properly (JSON Parse Error). I am sure this issue could manifest itself in other ways but this is the precise issue we are experiencing.
Could you please advise if you can replicate the issue and also if you are planning on fixing it.