Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

#8865 closed defect (bug) (fixed)

Filtering nouveau members buttons causing notice

Reported by: raviousprime's profile raviousprime Owned by: imath's profile imath
Milestone: 12.0.0 Priority: normal
Severity: normal Version: 3.0.0
Component: Templates Keywords: has-patch
Cc:

Description

When i am trying to reset members buttons in loop on my custom screen causing array to string notice

<?php
       // Current version of plugin
        $buttons_group = apply_filters( 'bp_nouveau_get_members_buttons', $buttons, $user_id, $type, $args );

        if ( ! $buttons_group ) {
             return $buttons;
        }

My fix

<?php
        $buttons_group = apply_filters( 'bp_nouveau_get_members_buttons', $buttons, $user_id, $type, $args );

        if ( ! $buttons_group ) {
             // empty array or buttons group itself.
             return $buttons_group;
        }

Please have a look.

Change History (3)

#1 @imath
2 years ago

  • Milestone changed from 11.2.0 to Awaiting Review

I’ll have a look at it asap.
Thanks for your report.

#2 @imath
2 years ago

  • Milestone changed from Awaiting Review to 12.0.0
  • Version changed from 11.1.0 to 3.0.0

#3 @imath
2 years ago

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

In 13447:

Disable single items loop's action buttons when their args are emptied
In BP Nouveau template pack, if some custom code is resetting single items loop's action buttons arguments using the bp_nouveau_get_groups_buttons or bp_nouveau_get_groups_buttons filters, instead of returning the default button arguments (which outputs are not yet generated) simply return an empty array.

Props raviousprime

Fixes #8865

Note: See TracTickets for help on using tickets.