Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/10/2024 07:57:42 PM (9 months 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.

Fixes #9241 (branch 14.0)
See #9162

File:
1 edited

Legend:

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

    r13882 r14044  
    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.