#8012 closed defect (bug) (fixed)
BP 4.0: Fatal Error re add new members in wp-admin > Groups > Group > Edit
Reported by: | shanebp | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.1.0 | Priority: | normal |
Severity: | major | Version: | |
Component: | Groups | Keywords: | needs-patch |
Cc: | shane@… |
Description
This error does not appear in BP 3.2.0
It occurs in BP 4.0
Go to dashboard > Groups > Group > Edit and see this error under Add Members
Fatal error: Uncaught Error: Call to undefined function wp_is_large_network() in /srv/www/wordpress-default/public_html/wp-content/plugins/buddypress.4.0/bp-groups/bp-groups-admin.php:864 Stack trace: #0 /srv/www/wordpress-default/public_html/wp-admin/includes/template.php(1073): bp_groups_admin_edit_metabox_add_new_members(Object(BP_Groups_Group), Array) #1 /srv/www/wordpress-default/public_html/wp-content/plugins/buddypress.4.0/bp-groups/bp-groups-admin.php(647): do_meta_boxes(Object(WP_Screen), 'normal', Object(BP_Groups_Group)) #2 /srv/www/wordpress-default/public_html/wp-content/plugins/buddypress.4.0/bp-groups/bp-groups-admin.php(490): bp_groups_admin_edit() #3 /srv/www/wordpress-default/public_html/wp-includes/class-wp-hook.php(286): bp_groups_admin('') #4 /srv/www/wordpress-default/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #5 /srv/www/wordpress-default/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /srv/www/wordpress-default/public_html/wp-admin/admin. in /srv/www/wordpress-default/public_html/wp-content/plugins/buddypress.4.0/bp-groups/bp-groups-admin.php on line 864
Attachments (3)
Change History (11)
#2
@
6 years ago
- Keywords needs-patch added
I can't do this until at least Monday, Dec 3, but someone else could.
#3
@
6 years ago
x.y.z =
x = "new feature(s) release"
y = "bug fix"
z = "security"
so 4.1.0 yes. Last digit for security releases only.
#4
@
6 years ago
I propose that we provide an is_large_network()
check that works for multisite and single-site installations, because it's handy, and single BP sites can easily exceed 10,000 users. I'm attaching a patch that introduces bp_is_large_network()
which is a wrapper for wp_is_large_network()
when it's available but also works for single sites. The only doubt I have is that I have added a new filter hook, bp_is_large_network
, but it is tempting to use the wp_is_large_network
hook for ease of development. Good idea? Or is it gauche to piggyback on existing filter hooks?
#5
@
6 years ago
3.diff is based on 2.diff, but suggests the following alterations:
- Prefer
bp_is_large_install()
overbp_is_large_network()
. Networks do not have user counts, removing a mild naming inaccuracy. (This also mirrors what's in bbPress.) - Use this new function in 1 extra place (inside
bp_blogs_record_existing_blogs()
) - Remove the
sites
vsusers
designation. BuddyPress will really only ever care about user counts, and has not ever used thesites
version ofwp_is_large_network()
. If it ever does, it will be able to use the core function. If BuddyPress needs a count of the number of sites in a network, it can rely on the WordPress core queries or functions. - Only applies the filters once at the end of the function. The WordPress core pattern of having 2
apply_filters()
calls that do the same thing inside the same function, is more confusing than it needs to be, and one I'd prefer we not follow in code that is under our influence.
#6
@
6 years ago
- Component changed from Core to Groups
I agree with @dcavins that we should call our own wrapper. I agree with @johnjamesjacoby that we should disregard sites for most purposes. I'll do some cleanup.
Thanks for the report @shanebp. I guess this didn't get wrapped in a multisite check. We'll need to push out a 4.0.1 (or 4.1.0? I don't understand our new version numbering scheme @djpaul) in the upcoming days to fix.