Skip to:
Content

Opened 9 months ago

Closed 4 months ago

Last modified 4 months ago

#5134 closed defect (bug) (duplicate)

Members Buttons Not Showing (v1.8)

Reported by: dunhakdis Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.8
Component: Core Keywords: needs-patch reporter-feedback
Cc:

Description

I'm currently working on a new buddypress theme using the default one for my client when I encounter this bug. Normally, when we create themes the sidebar usually follow after the content or geek speak after this action:

<?php do_action( 'bp_member_header_actions' ); ?>

I have a special need that I need to load the sidebar before the content or before the said action.

Now, when I add members widget or groups widget under the said sidebar, the buttons ('add friend','public message','private message' are nowhere to be found. When I remove the said widgets, the buttons seems to appear normally now.

I google for some threads related to my problem and found this http://buddypress.org/support/topic/buddypress-1-8-issue/ to be helpful. With my initiative, I search for what has caused the bug, and it might be my theme.

I ended up opening bp-core-classes.php, under the constructor, we can actually see what's going on. Now, I tested each conditional tags ( there are around 5 i think ) and see that the following code the cause of the bug:

// No button if you are the current user in a loop
if ( true === $this->block_self && is_user_logged_in() && bp_loggedin_user_id() === bp_get_member_user_id() )
return false;

I noticed that it checks for

is_user_logged_in()

which is fairly confusing because we need to be login inorder to add friends, etc.

I tried changing that line into:

// No button if you are the current user in a loop
if ( true === $this->block_self && !is_user_logged_in() && bp_loggedin_user_id() === bp_get_member_user_id() )
return false;

and boom it works! :)

I hope this is a real bug and not cause my buddypress to behave unexpectedly, although it was running smoothly since the last time I modified it (last week)..

Hope this helps. Thank you so much.

Change History (5)

comment:1 DJPaul8 months ago

  • Keywords reporter-feedback added

Interesting that you say the sidebar is being loaded before the main part of the theme.

In that sidebar, on the pages where this logic broke, do you have the "Who's Online" widget?

comment:2 dunhakdis8 months ago

No, I dont have "Who's Online Widgets". I haven't tested if the problem exist with that widget. The only thing I can confirm is when 'Members' widget and 'Groups' widget are loaded before the main part of the theme, it does broke.

Thanks :)

Last edited 8 months ago by dunhakdis (previous) (diff)

comment:3 nikopaulanne6 months ago

Confirmed problem:

I have the same problem with 3rd party theme Magazine Basic (http://wordpress.org/themes/magazine-basic) when there is 2-columns enabled in theme settings. When the "Who's Online" widget is enabled on the left side bar it disables the button rendering on member profile.

On the other site with similar setup on same theme the "who's online" works OK in right side column.

comment:4 DJPaul4 months ago

  • Resolution set to duplicate
  • Status changed from new to closed

Yep, known issue; we have an existing ticket. Thanks for confirming, see #5170

comment:5 DJPaul4 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.