Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/10/2024 07:55:18 PM (2 years ago)
Author:
imath
Message:

Move the invite_status group meta check out of groups_join_group()

[13874] introduced a regression where groups whose creation process is abandoned become unjoinable & or when using the WP BuddyPress CLI to create groups.

To avoid this, we now perform the check higher up the chain, namely in the places in BuddyPress where groups_join_group() is called.

Props boonebgorges, vapvarun.

See #9241 (trunk)
Fixes #9238
Closes ​https://github.com/buddypress/buddypress/pull/381

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r14013 r14043  
    16151615                        if ( ! bp_current_user_can( 'groups_join_group', array( 'group_id' => $group->id ) ) ) {
    16161616                                esc_html_e( 'Error joining group', 'buddypress' );
     1617                        }
     1618
     1619                        /*
     1620                         * Ensure that the invite_status key exists, to avoid a group
     1621                         * being joinable when its creation process was interrupted.
     1622                         */
     1623                        if ( ! groups_get_groupmeta( $group->id, 'invite_status' ) ) {
     1624                                esc_html_e( 'Error joining group', 'buddypress' );
     1625                                break;
    16171626                        }
    16181627
Note: See TracChangeset for help on using the changeset viewer.