woocommerce/assets/js/admin
Brent Shepherd 501f0b752f Save product type before saving variations
WooCommerce prior to WC 2.4 saved the product type before any variations were saved because
WC_Meta_Box_Product_Data::save_variations() was called by WC_Meta_Box_Product_Data::save().
However, in WC 2.4 the variations are saved independently of other data about the containing
variable product, including product type. Because the product type hasn't been saved yet,
extensions that need to save their own variation level meta data can't know when saving
variations if the product is of the type they want to act on. They also can't check `$_POST`
to find out when saving variations, because 'product-type' isn't passed to that as it's
variable level meta data, not variation level meta data.

This patch passes the product type along with the variation level meta data when saving variations.
It then uses that to save the product type if the variable product has not yet been saved (and
therefore the product type has never been stored, which means calling get_product() would instantiate
a 'simple' product, as that is the default product type). This can lead to fatal errors if callbacks
expect the product type to be variable and attempt to call methods that only exist on those product
types, like variable_product_sync().

It will also update the product type if it was previously saved but has since changed. This prevents
fatal errors like that mentioned above but caused by switching from one product type, like a simple
product, to another, like a variable product.
2015-07-31 11:42:21 -07:00
..
accounting.js Updated accounting.js 2015-07-10 01:31:57 -03:00
accounting.min.js Minify 2015-07-10 20:17:47 -03:00
api-keys.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
api-keys.min.js Hide api key fields when generate a new keys 2015-06-08 20:22:49 -03:00
jquery.flot.js fixed the access permissions 2014-09-01 12:44:51 -03:00
jquery.flot.min.js Minify 2015-07-10 20:17:47 -03:00
jquery.flot.pie.js Work on charts/reports 2013-06-22 11:37:59 +01:00
jquery.flot.pie.min.js Minify 2015-07-10 20:17:47 -03:00
jquery.flot.resize.js fixed the access permissions 2014-09-01 12:44:51 -03:00
jquery.flot.resize.min.js Minify 2015-07-10 20:17:47 -03:00
jquery.flot.stack.js Customer reports 2013-07-09 15:31:22 +01:00
jquery.flot.stack.min.js Result of Grunt minification + tx pull 2014-02-03 14:35:26 +00:00
jquery.flot.time.js fixed the access permissions 2014-09-01 12:44:51 -03:00
jquery.flot.time.min.js Minify 2015-07-10 20:17:47 -03:00
meta-boxes-coupon.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
meta-boxes-coupon.min.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
meta-boxes-order.js Fixed js coding standards on assets/js/admin/meta-boxes-order.js and removed a reserved namespace 2015-07-08 02:19:56 -03:00
meta-boxes-order.min.js Fixed js coding standards on assets/js/admin/meta-boxes-order.js and removed a reserved namespace 2015-07-08 02:19:56 -03:00
meta-boxes-product-variation.js Save product type before saving variations 2015-07-31 11:42:21 -07:00
meta-boxes-product-variation.min.js Allow menu_order sorting like in 2.3 2015-07-31 12:39:23 +01:00
meta-boxes-product.js gallery images where not saving 2015-07-27 09:57:21 -07:00
meta-boxes-product.min.js min 2015-07-27 19:03:17 +01:00
meta-boxes.js Allow menu_order sorting like in 2.3 2015-07-31 12:39:23 +01:00
meta-boxes.min.js Allow menu_order sorting like in 2.3 2015-07-31 12:39:23 +01:00
order-backbone-modal.js Don't react with enter key for textarea on backbone modal used for tinyMCE 2015-04-16 19:10:56 +05:45
order-backbone-modal.min.js Minify 2015-07-10 20:17:47 -03:00
product-ordering.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
product-ordering.min.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
quick-edit.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
quick-edit.min.js Autosuggest product tags on bulk edit 2014-11-29 23:59:58 -05:00
reports.js Fixed all jshint errors #4680 2015-07-10 02:13:30 -03:00
reports.min.js Fixed all jshint errors #4680 2015-07-10 02:13:30 -03:00
round.js Rounding + precision for taxes. Store unrounded. Round down (for the moment) for taxes 2013-10-24 13:15:42 +01:00
round.min.js Result of Grunt minification + tx pull 2014-02-03 14:35:26 +00:00
settings.js Remove references to color_box in the CSS & JS now that it is no longer used. 2015-06-11 15:01:39 +00:00
settings.min.js Minify 2015-07-10 20:17:47 -03:00
term-ordering.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
term-ordering.min.js Minify js for #8290 2015-06-05 11:52:15 -03:00
users.js Fixed all jshint errors #4680 2015-07-10 02:13:30 -03:00
users.min.js [2.3] Removed state placeholders in user profile #8043 2015-04-28 13:33:00 -03:00
wc-enhanced-select.js Added param for exclude posts from wc-product-search, closes #8613 2015-07-20 13:41:14 -03:00
wc-enhanced-select.min.js Added param for exclude posts from wc-product-search, closes #8613 2015-07-20 13:41:14 -03:00
wc-setup.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
wc-setup.min.js Use always min.js files on admin 2015-07-10 01:32:30 -03:00
woocommerce_admin.js Merged #8021 2015-05-18 16:53:04 -03:00
woocommerce_admin.min.js Merged #8021 2015-05-18 16:53:04 -03:00