Commit Graph

6 Commits

Author SHA1 Message Date
JeroenSormani a29ba23fab Miscellaneous cleanup of typos + change some return types for IDE helpers 2017-03-20 11:03:14 +01:00
Justin Shreve 9724b67ab8 Fix order item meta functions cache busting.
The cache busting currently in `wc_add_order_item_meta`, `wc_update_order_item_meta`, and `wc_delete_order_item_meta` doesn't actually bust anything. The cache line looks like it is from 2.6. The relevent cache to bust is actually in the `order-items` group and has a different key/prefix.
This bug allows your meta to get out of sync if you use these functions and then try to access a value from a CRUD object.

You can see this in the `test_wc_order_item_meta_functions` test I've added. If you keep your `wc-order-item-functions.php` as is, the asserts against `$item->get_meta` will fail.

To test:
* `phpunit --filter=test_wc_order_item_meta_functions`.
* Try before applying the `wc-order-item-functions.php` changes and after.
2017-03-09 13:36:23 -08:00
Justin Shreve 98343ffe26 Fix docblocks and cast the order ID as int after our query. 2017-01-19 09:38:23 -08:00
Justin Shreve a1446c9591 Add method for getting order id from order item id. 2017-01-19 09:30:19 -08:00
Justin Shreve 9b08f4b32d Move order-item-functions queries to a data store. Rebase & update to use download data store. 2016-11-21 11:38:07 -08:00
Mike Jolley ac3be6ba50 Order stores complete 2016-11-18 14:07:21 +00:00