Make WordPress Core

Opened 6 months ago

Last modified 5 months ago

#63518 new defect (bug)

get_blog_details( get_all: false ) not working as expected

Reported by: apermo's profile apermo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch changes-requested reporter-feedback
Focuses: multisite Cc:

Description

I recently played around with get_blog_details() and found that the second parameter is not as expected.

<?php
get_blog_details( 1, true ); // will return the long results.
get_blog_details( 1, false ); // will also return the long results.

get_blog_details( 2, false ); // will return the short results.
get_blog_details( 2, true ); // will return the long results.
get_blog_details( 2, false ); // will still return the short results.

So if you call it with $get_all = false first, it works as expected and it seems to cache the short result separately and you can call them in any order and how often you want.
If you call $get_all = true first, it will ignore the second parameter and will always return the long results.

It seems to me like the caching in the function is not working properly.

Attachments (1)

63518.patch (1.3 KB) - added by immeet94 6 months ago.

Download all attachments as: .zip

Change History (7)

@immeet94
6 months ago

#1 @immeet94
6 months ago

  • Keywords has-patch needs-testing added

Hey @apermo
Thanks for created ticket and i created patch for that, please review and test it.let me know for query.
Thanks

#2 @apermo
6 months ago

Hey @immeet94 thank you for the patch.
I tried to apply your patch and test it, but I could not find where to apply your patch, checked with 6.8.1 and trunk.

Could you verify your patch?

Greetings from WCEU2025

#3 @ravigadhiyawp
5 months ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8.1
  • PHP: 8.2.23
  • Server: nginx/1.26.1
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.2.23)
  • Browser: Chrome 137.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ❌ Error condition not occurs (not reproduced).

Additional Notes

  • To reproduce the issue, I printed the result returned by get_blog_details() as suggested by @apermo . It appears to be working as expected upon inspection. I couldn’t find any issue.

Supplemental Artifacts

Screenshot: https://prnt.sc/ipp9hsBdXHWT

#4 @SirLouen
5 months ago

  • Keywords changes-requested added; needs-testing removed

#5 @SirLouen
5 months ago

  • Keywords reporter-feedback added

#6 @debarghyabanerjee
5 months ago

I tried reproducing the issue reported, but I couldn't reproduce it as well.

Note: See TracTickets for help on using tickets.