fix: Fixes the broken caching issue in get_blog_details()#11016
fix: Fixes the broken caching issue in get_blog_details()#11016apermo wants to merge 1 commit intoWordPress:trunkfrom
Conversation
When get_blog_details() is called with $get_all=true first, the full result is cached. A subsequent call with $get_all=false incorrectly returns the full cached result instead of a short one. The "try the other cache" block now discards the full cache hit when short is requested, allowing WP_Site::get_instance() to build a clean short result without an extra DB query. Ref: https://core.trac.wordpress.org/ticket/63518#ticket
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
Failing test: Tests_Error_Protection_wpRecoveryModeKeyService::test_validate_recovery_mode_key_returns_wp_error_if_bad Issue: Expects 'invalid_recovery_key_format' but gets 'token_not_found' |
When
get_blog_details()is called with$get_all = truefirst, the full result is cached. A subsequent call with $get_all=false incorrectly returns the full cached result instead of a short one.The "try the other cache" block now discards the full cache hit when short is requested, allowing
WP_Site::get_instance()to build a clean short result without an extra DB query.Trac ticket: https://core.trac.wordpress.org/ticket/63518#ticket
Use of AI Tools
AI used to dig deeper into the issue, to write documentation and to help writing unit test.
Everything generated was reviewed afterwards.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.