Members Buttons Not Showing (v1.8)
|Reported by:||dunhakdis||Owned by:|
|Component:||Component - Core||Keywords:||needs-patch reporter-feedback|
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
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.