Skip to:
Content

BuddyPress.org

Opened 4 years ago

Closed 4 years ago

#8298 closed defect (bug) (fixed)

Deprecated: groups_send_membership_request

Reported by: n33d's profile N33D Owned by: imath's profile imath
Milestone: 6.1.0 Priority: low
Severity: normal Version: 5.0.0
Component: Templates Keywords: has-patch commit
Cc:

Description

Hi there,

There is a PHP file which I include in the group single page by using:

<?php
function action_bp_after_group_header(  ) { 
    require_once(JV_SERVER_DIR .'/templates/partials/buddypress/group/single/group_actions.php');
}; 
add_action( 'bp_after_group_header', 'action_bp_after_group_header', 10, 0 );

In this file I call the following function:

<?php if ( groups_is_user_admin( $user_id, $group_id ) !== $group_id ): ?>
   <?php bp_group_join_button(); ?>
<?php endif; ?>

Once clicked I get the following error:

Deprecated: groups_send_membership_request was called with an argument that is deprecated since version 5.0.0! Arguments passed to groups_send_membership_request should be in an associative array. See the inline documentation at /Users/****/Sites/mvp/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php for more details. in /Users/****/Sites/mvp/wp-includes/functions.php on line 4997

Warning: Cannot modify header information - headers already sent by (output started at /Users/****/Sites/mvp/wp-includes/functions.php:4997) in /Users/****/Sites/mvp/wp-includes/pluggable.php on line 1281

Warning: Cannot modify header information - headers already sent by (output started at /Users/****/Sites/mvp/wp-includes/functions.php:4997) in /Users/****/Sites/mvp/wp-includes/pluggable.php on line 1284

I use the latest version of WordPress and BuddyPress.

Though, the request was made and functionality is working.

Attachments (1)

8298.01.patch (2.4 KB) - added by r-a-y 4 years ago.

Download all attachments as: .zip

Change History (5)

#1 @r-a-y
4 years ago

  • Component changed from Groups to Templates
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 6.1.0
  • Priority changed from high to low
  • Severity changed from major to normal
  • Version changed from 5.2.0 to 5.0.0

Thanks for the report, @N33D.

This is a relatively minor issue. You should turn off WP_DEBUG on your site so developer notices are not shown on your production site.

As for the problem, changes were made as part of #6210 to deprecate the usage of function arguments for the groups_send_membership_request() function. See r12429.

We still use the older function arguments in parts of the codebase. Attached patch should fix this.

@r-a-y
4 years ago

#2 @imath
4 years ago

  • Keywords commit added

Looks good to me @r-a-y 👌 Thanks a lot.

#3 @imath
4 years ago

In 12671:

BP Templates: stop using deprecated function arguments

Changes were made as part of r12429 to deprecate the usage of function arguments for the groups_send_membership_request() function.

Some parts of our codebase (mainly in our Template packs) were still using these deprecated arguments.

This commit makes sure we are using the most recent arguments when using this function.

Props r-a-y, N33D

See #8298 (branch 6.0)

#4 @imath
4 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12672:

BP Templates: stop using deprecated function arguments

Changes were made as part of r12429 to deprecate the usage of function arguments for the groups_send_membership_request() function.

Some parts of our codebase (mainly in our Template packs) were still using these deprecated arguments.

This commit makes sure we are using the most recent arguments when using this function.

Props r-a-y, N33D

Fixes #8298 (trunk)

Note: See TracTickets for help on using tickets.