Cannot assign attributes to a product after upgrading to Woocommerce 3.5.1
-
I found on the Edit Product screen (in the admin) you can assign and save attributes to a product and whilst they do save, the attributes appear to refresh via ajax and are shown as blank. If you reload the page in full, the attributes come back. This happened after upgrading Woocommerce to version 3.5.1
I have tracked this issue down to line 195 of the file includes/class-admin.php:
global $thepostid;
It appears that $thepostid is an integer when the edit page is first loaded, but after saving the attributes, they refresh via ajax and $thepostid is then null.
A very quick work around which seems to work for me is to add, directly below “global $thepostid” the following:
global $thepostid;
if ( ! $thepostid ) {
$thepostid = $_POST[‘post_id’];
}
- The topic ‘Cannot assign attributes to a product after upgrading to Woocommerce 3.5.1’ is closed to new replies.