null qty produces warning
-
In some cases get_stock_quantity might return null. In this case it would be better for script to either:
a) default to 0 when null is returned
b) allow nullable qty on databaseCurrently it just triggers PHP warnings.
2019/12/09 17:43:05 [error] 14458#14458: *1597126 FastCGI sent in stderr: “PHP message: WordPress database error Column ‘qty’ cannot be null for query INSERT INTO
nrugs_stock_log
(date_created
,qty
,product_id
) VALUES (‘2019-12-09 17:43:05’, NULL, ‘349036’) made by do_action(‘wp_ajax_woocommerce_save_attributes’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::save_attributes, WC_Product->save, WC_Data_Store->update, WC_Product_Data_Store_CPT->update, WC_Product_Data_Store_CPT->handle_updated_props, do_action(‘woocommerce_product_set_stock’), WP_Hook->do_action, WP_Hook->apply_filters, Stock_Manager->save_stock” while reading response header from upstream
- The topic ‘null qty produces warning’ is closed to new replies.