woocommerce/tests/php/includes/rest-api/Controllers
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
..
Version1 Fix wrong caching of taxonomy in terms and attributes controllers. 2021-02-12 15:12:58 +01:00
Version2 More for individual fields in responses for V2 and V3 products and orders endpoints. 2021-01-06 16:04:56 +05:30
Version3 Fix wrong caching of taxonomy in terms and attributes controllers. 2021-02-12 15:12:58 +01:00