From fe4a4a7e834198288ae26fc9131ef13b2d043669 Mon Sep 17 00:00:00 2001 From: Dixita Dusara Date: Thu, 25 May 2017 15:28:32 +0530 Subject: [PATCH] Update issue Undefined index warning when saving variations with stock management disabled #15242 (#15271) * Issue Undefined index warning when saving variations with stock management disabled #15242 * updated issue as per your suggestion for index warning when saving variations with stock management disabled #15242 --- includes/admin/meta-boxes/class-wc-meta-box-product-data.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/meta-boxes/class-wc-meta-box-product-data.php b/includes/admin/meta-boxes/class-wc-meta-box-product-data.php index 27db30dcdce..d92750d8008 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-product-data.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-product-data.php @@ -409,8 +409,8 @@ class WC_Meta_Box_Product_Data { isset( $_POST['_wc_variation_file_hashes'][ $variation_id ] ) ? $_POST['_wc_variation_file_hashes'][ $variation_id ] : array() ), 'manage_stock' => isset( $_POST['variable_manage_stock'][ $i ] ), - 'stock_quantity' => isset( $_POST['variable_stock'][ $i ] ) ? wc_clean( $_POST['variable_stock'][ $i ] ) : null, - 'backorders' => isset( $_POST['variable_backorders'][ $i ] ) ? wc_clean( $_POST['variable_backorders'][ $i ] ) : null, + 'stock_quantity' => isset( $_POST['variable_stock'], $_POST['variable_stock'][ $i ] ) ? wc_clean( $_POST['variable_stock'][ $i ] ) : null, + 'backorders' => isset( $_POST['variable_backorders'], $_POST['variable_backorders'][ $i ] ) ? wc_clean( $_POST['variable_backorders'][ $i ] ) : null, 'stock_status' => wc_clean( $_POST['variable_stock_status'][ $i ] ), 'image_id' => wc_clean( $_POST['upload_image_id'][ $i ] ), 'attributes' => self::prepare_set_attributes( $parent->get_attributes(), 'attribute_', $i ),