Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/05/2022 05:25:42 AM (3 years ago)
Author:
imath
Message:

Update the GH action WP testing matrix, WP PHPunit and @wordpress/env

This commit also fixes:

  • a GH action issue when testing WP < 6.1. In this case we need to downgrade WP PHPunit to a version lower than 6.1.0 to avoid @wordpress/env unit test command to fail (Internal Server Error).
  • the database error when running the BP_Tests_Groups_Functions test.

Closes https://github.com/buddypress/buddypress/pull/34
Fixes #8759

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/classes/class-bp-groups-group.php

    r13280 r13355  
    395395
    396396        // Fetch the user IDs of all the members of the group.
    397         $user_ids    = BP_Groups_Member::get_group_member_ids( $this->id );
    398         $user_id_str = esc_sql( implode( ',', wp_parse_id_list( $user_ids ) ) );
    399 
    400         // Modify group count usermeta for members.
    401         $wpdb->query( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_id_str} )" );
     397        $user_ids = BP_Groups_Member::get_group_member_ids( $this->id );
     398
     399        if ( $user_ids ) {
     400            $user_id_str = esc_sql( implode( ',', wp_parse_id_list( $user_ids ) ) );
     401
     402            // Modify group count usermeta for members.
     403            $wpdb->query( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_id_str} )" );
     404        }
    402405
    403406        // Now delete all group member entries.
     
    419422
    420423        // Finally remove the group entry from the DB.
    421         if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name} WHERE id = %d", $this->id ) ) )
     424        if ( ! $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name} WHERE id = %d", $this->id ) ) ) {
    422425            return false;
     426        }
    423427
    424428        return true;
Note: See TracChangeset for help on using the changeset viewer.