Opened 7 years ago
Closed 7 years ago
#40247 closed defect (bug) (fixed)
Fix the `site-details` cache not being set sometimes
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Networks and Sites | Keywords: | has-patch has-unit-tests |
Focuses: | multisite | Cc: |
Description
When introducing the lazy-loading functionality for sites in 37918, we made a mistake as far as I can see: In WP_Site::get_details()
we check for falsy site detail values, and if one of them is false, the data is not cached. This is a problem, since sometimes that data can actually be not set (mainly post_count
).
When reading through the original ticket #36935, the reason we implemented this check was so that the function wouldn't cache an invalid dataset when requesting site details too early (for example in sunrise.php
). However, a little further in that discussion we decided that we'd introduce the ms_loaded
hook and use that for detection instead. That's what we ended up doing, but never removed the original checks, which should under those new circumstances be unnecessary, and actually cause this problem.
Attachments (1)
Change History (4)
#1
@
7 years ago
- Keywords has-patch has-unit-tests added; needs-patch removed
- Milestone changed from Awaiting Review to 4.8
40247.diff fixes the bug and introduces a new unit test for the issue.