[buddypress-trac] [BuddyPress] #5134: Members Buttons Not Showing (v1.8)
buddypress-trac
noreply at wordpress.org
Wed Aug 7 05:06:34 UTC 2013
#5134: Members Buttons Not Showing (v1.8)
--------------------------+-----------------------------
Reporter: dunhakdis | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version: 1.8
Severity: normal | Keywords: needs-patch
--------------------------+-----------------------------
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.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5134>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list