[wp-trac] [WordPress Trac] #63730: get_blogs_of_user running on single install and crashes

WordPress Trac noreply at wordpress.org
Tue Jul 22 06:22:04 UTC 2025


#63730: get_blogs_of_user running on single install and crashes
--------------------------+------------------------------
 Reporter:  Keffr3n       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  6.8.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by abcd95):

 * keywords:  needs-testing =>


Comment:

 == Reproduction Report
 === Description
 This report validates that the issue can be reproduced.

 The function `get_blogs_of_user()` incorrectly returns an array with an
 `stdClass` object that is missing the `blog_id` property. Downstream code
 expects a valid blog_id.

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.25
 - Server: nginx/1.27.2
 - Database: mysqli (Server: 8.4.4 / Client: mysqlnd 8.2.25)
 - Browser: Chrome 138.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.3
 - MU Plugins: None activated
 - Plugins:
   * Query Monitor 3.18.0

 === Reproduction steps

 - Spin up a single-site instance (no multisite enabled).
 - Activate Query Monitor ( or anything that uses `blog_id` later)
 - Add the test code snippet from the ticket to hook into init and call
 `get_blogs_of_user()` for the current user.
 - Make sure the debugging is enabled
 - Visit any admin page to trigger the code.
 - Check the debug output


 === Actual Results
 ✅ Error condition occurs (reproduced).

 === Additional Notes

 Debug logs confirm the blog_id is missing from the returned object -

 {{{

 [DEBUG] get_blogs_of_user() returned: Array
 (
     [1] => stdClass Object
         (
             [userblog_id] => 1
             [blogname] => wordpress-develop
             [domain] =>
             [path] =>
             [site_id] => 1
             [siteurl] => http://localhost:8889
             [archived] => 0
             [spam] => 0
             [deleted] => 0
             // Missing 'blog_id'
         )
 )
 }}}


 === Supplemental Artifacts

 Full debug output - [https://i.ibb.co/9kc5h4Q4/carbon.png screenshot]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63730#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list