woocommerce/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 Merge pull request #28679 from woocommerce/fix/woocommerce-gutenberg-products-block-issues-3565 2021-01-18 19:26:34 -03:00
Version3 Fix wrong caching of taxonomy in terms and attributes controllers. 2021-02-12 15:12:58 +01:00