[buddypress-trac] [BuddyPress Trac] #7585: Issues with $has_access

buddypress-trac noreply at wordpress.org
Wed Aug 16 07:38:18 UTC 2017


#7585: Issues with $has_access
--------------------------+------------------------------
 Reporter:  udarmo        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Core          |     Version:  2.9.0
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------
Changes (by udarmo):

 * cc: inna.zengin@… (added)


Comment:

 Replying to [comment:2 bhargavbhandari90]:
 Hi,
 Both your parts of the answer is for my part/issue 1, I wasn't able to
 open the single activity item, because of bp_displayed_user_id() = 0. So,
 first I have paid attention that links to comment from emails (like "you
 have new comment to your post/activity") leading to user's (who's clicking
 on the link) profile with "you do not have access to this activity" error
 notification. So I was going to side-wide activity page and replying just
 from there. Or from specific user's activity (from his profile).
 But after that I made some changes, removed user's activity from profile
 by this code in functions.php:
 {{{#!php
 <?php
 if( !defined( 'BP_DEFAULT_COMPONENT' ) ){
     define( 'BP_DEFAULT_COMPONENT', 'profile' );
 }
 function bp_remove_profile_tab_activity(){
     bp_core_remove_nav_item('activity');
 }
 add_action( 'bp_setup_nav', 'bp_remove_profile_tab_activity', 900 );
 }}}
 and comments from site-wide activity page by this in entry.php:
 {{{#!php
 <?php if ( bp_activity_can_comment() ) : ?>
     <?php if ( bp_is_single_activity() ) : ?>
          <a href="<?php bp_activity_comment_link(); ?>" class="button
 acomment-reply bp-primary-action" id="acomment-comment-<?php
 bp_activity_id(); ?>"><?php printf( __( 'Comment %s', 'buddypress' ),
 '<span>' . bp_activity_get_comment_count() . '</span>' ); ?></a>
     <?php else : ?>
          <a href="<?php bp_activity_thread_permalink() ?>" class="button
 acomment-reply bp-primary-action" id="acomment-comment-<?php
 bp_activity_id(); ?>"><?php printf( __( 'Comment %s', 'buddypress' ),
 '<span>' . bp_activity_get_comment_count() . '</span>' ); ?></a>
     <?php endif; ?>
 <?php endif; ?>
 }}}
 And only then I started to check the code for '''$has_access'''. It means,
 that the error for "you do not have access bla-bla" was before I made
 changes, but I have started to debug the code only after my changes.

 Hope, now it's clearer :)

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7585#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list