Opened 16 years ago
Closed 16 years ago
#564 closed defect (bug) (duplicate)
SQL error in bp-groups-classes.php
Reported by: | conceptfusion | Owned by: | |
---|---|---|---|
Milestone: | Priority: | major | |
Severity: | Version: | 1.0 | |
Component: | Keywords: | ||
Cc: |
Description
Function: get_all( $limit = null, $page = null, $only_public = true, $sort_by = false, $order = false ) beginning on line 406 of /bp-groups/bp-groups-classes.php
Error: the SQL statement in the else clause on line 435 is missing the "g." before id and slug in the SELECT and the "g" after the {$bp->groups->table_name} in the FROM
Should read:
$sql = $wpdb->prepare( "SELECT g.id as group_id, g.slug FROM {$bp->groups->table_name} g {$public_sql} {$hidden_sql} {$order_sql} {$pag_sql}" );
This may be a silent bug for most users but was causing the following fatal internal server error in the response header of the site admin page call for groups under wp-admin:
WordPress database error Unknown table 'g' in where clause for query SELECT id as group_id, slug FROM wp_bp_groups WHERE g.status = 'public' made by require_once, do_action, call_user_func_array, groups_admin_settings , bp_has_groups, BP_Groups_Template->bp_groups_template, groups_get_all, BP_Groups_Group->get_all
Duplicate, this is fixed.