Commit Graph

12 Commits

Author SHA1 Message Date
Nestor Soriano 4e195d5f3f Fix code sniffer errors. 2021-02-12 15:29:32 +01:00
Nestor Soriano 00d6dc40f7 Fix wrong caching of taxonomy in terms and attributes controllers.
The WC_REST_Terms_Controller and WC_REST_Product_Attributes_V1_Controller
classes have a get_taxonomy method that gets the name of the taxonomy
to process from a taxonomy id passed in the request, but once the
taxonomy name has been obtained it's cached and sbsequently reused.
The problem is that these controller instances are reused if more than
one request is processed programmatically, and thus the taxonomy that
was cached once is always used even if the new request specifies a
different taxonomy id.

The fix consists of using a dictionary of taxonomy id - taxonomy name
instead of one single taxonomy for caching.

In the case of WC_REST_Terms_Controller there's a protected $taxonomy
property that needs to be kept for compatibility, it's now set to
the last taxonomy name that has been introduced in the dictionary.
2021-02-12 15:12:58 +01:00
Claudio Sanches 27e4288eab
Merge pull request #27934 from woocommerce/remove_get_product_from_item
Remove the remaining uses of $order->get_product_from_item()
2020-10-14 16:18:29 -03:00
Ron Rennick 8ec54fabe0 phpcs fixes 2020-10-14 10:27:58 -03:00
James Allan 1fcedb5279 Removes the remaining uses of $order->get_product_from_item 2020-10-13 11:24:48 +10:00
Ron Rennick 24ec59cf26 fix merge conflict 2020-10-07 15:19:05 -03:00
Claudio Sanches 70c7adfeb7 Fixed usage of package tag in REST API and templates 2020-09-17 11:56:08 -03:00
Ron Rennick 2fd12604ef move update to v2 controller 2020-08-13 09:32:01 -03:00
Ron Rennick 71def437f7 phpcs fixes 2020-08-12 14:34:57 -03:00
Ron Rennick c605b93737 add get single tax class, support cli tax class delete 2020-08-11 17:34:46 -03:00
vedanshujain 1966b0ba9a Changed textdomain since API is merged into core now. 2020-08-06 18:18:18 +05:30
vedanshujain 55a9687e6d Make api included structure more linear. 2020-08-06 14:34:02 +05:30