[buddypress-trac] [BuddyPress Trac] #8414: Tools > "Repair site tracking site icons" generates PHP Fatal error when not on Multisite

buddypress-trac noreply at wordpress.org
Sat Dec 12 20:18:01 UTC 2020


#8414: Tools > "Repair site tracking site icons" generates PHP Fatal error when
not on Multisite
--------------------------+-----------------------------
 Reporter:  slaFFik       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Blogs         |    Version:  7.0.0
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If you open Tools > BuddyPress page in `/wp-admin/tools.php?page=bp-tools`
 and try to run "Repair site tracking site icons/blog avatars
 synchronization." operation while NOT being on WP Multisite - the action
 will generate a fatal error:

 {{{
 PHP Fatal error:  Uncaught Error: Call to undefined function get_sites()
 in trunk\wp-content\plugins\buddypress\src\bp-core\admin\bp-core-admin-
 tools.php:337
 Stack trace:
 #0 trunk\wp-content\plugins\buddypress\src\bp-core\admin\bp-core-admin-
 tools.php(83): bp_admin_repair_blog_site_icons()
 #1 trunk\wp-includes\class-wp-hook.php(287): bp_admin_repair_handler()
 #2 trunk\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters()
 #3 trunk\wp-includes\plugin.php(484): WP_Hook->do_action()
 #4 trunk\wp-admin\includes\menu.php(155): do_action()
 #5 trunk\wp-admin\menu.php(327): require_once('C:\\OpenServer\\d...')
 #6 trunk\wp-admin\admin.php(158): require('C:\\OpenServer\\d...')
 #7 trunk\wp-admin\tools.php(40): require_once('C:\\OpenServer\\d...')
 #8 {main}
   thrown in trunk\wp-content\plugins\buddypress\src\bp-core\admin\bp-core-
 admin-tools.php on line 337
 }}}

 It looks like this was introduced in BP 7 (see #8384).

 Multisite-related operation "Repopulate site tracking records." works fine
 because it uses a function `bp_blogs_record_existing_blogs()` which does
 all the proper `is_multisite()` checks.
 And `bp_admin_repair_blog_site_icons()` used in a failing operation calls
 `get_sites()` directly without safety checks first.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8414>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list