#30749 closed defect (bug) (fixed)
get_term() is missing cache in some cases
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.1 | Priority: | normal |
| Severity: | blocker | Version: | |
| Component: | Taxonomy | Keywords: | has-patch fixed-major |
| Focuses: | Cc: |
Description
As reported in https://wordpress.org/support/topic/tagcloud-widget-categories-significant-sql-query-increase?replies=2. On sites with large numbers of categories, both tag cloud and category widgets are missing the cache when building markup (via get_term_link() -> get_term()). My bisect tools are telling me that this dates from [29915]; see #21760. The changes related to #21760 were supposed to have been reverted in [30900], but it appears that something was missed there. I'm investigating.
Attachments (2)
Change History (11)
This ticket was mentioned in Slack in #core by boone. View the logs.
11 years ago
This ticket was mentioned in Slack in #core by boone. View the logs.
11 years ago
#4
@
11 years ago
30749.2.patch adds unit tests for the other cache-setting parts that were touched in [30900]. Everything is passing as expected.
This ticket was mentioned in Slack in #core by boone. View the logs.
11 years ago
#6
@
11 years ago
- Owner set to boonebgorges
- Resolution set to fixed
- Status changed from new to closed
In 30954:
#7
@
11 years ago
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for the 4.1 branch.
30749.patch fixes the issue. As I suspected, I missed something when cleaning up #21760 [30900] -
get_terms()must update the cache for the term objects that it locates. I've added a unit test to make sure this doesn't happen again.