[buddypress-trac] [BuddyPress Trac] #7585: Issues with $has_access
buddypress-trac
noreply at wordpress.org
Tue Aug 15 16:09:34 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 | Keywords:
--------------------------+-----------------------------
Hi,
I’m using BP 2.9 and WP 4.8.1 and Buddy theme.
There were 2 issues with that:
1. Suddenly I wasn't able to open single activity item. Before this I
didn't use it (single activity) much, so I don't know if this issue was
from the beginning (the website is still not in production). So I found
that this piece of code:
{{{#!php
<?php
// If activity author does not match displayed user, block access.
if ( true === $has_access && bp_displayed_user_id() !== $activity->user_id
) {
$has_access = false;
}
}}}
is always returning $has_access = false, because on the activity page
'''bp_displayed_user_id()''' is always = 0. I have tried to change my
theme to Twenty Seventeen with no success (for bug). So I just commented
the lines in bp-activity-screens.php and everything was working again.
2. Second issue happened yesterday after installing
[https://wordpress.org/plugins/buddypress-media/ rtMedia plugin].
$has_access became empty after these lines:
{{{#!php
<?php
$has_access = apply_filters_ref_array( 'bp_activity_permalink_access',
array( $has_access, &$activity ) );
}}}
I don't really understand the connection between rtMedia plugin and
Activity. Not familiar with BP core. If I am disabling the rtMedia plugin
- works fine. But I need the plugin, so I fixed it by setting $has_access
= true if this line returns it empty. Now it's working again with the
plugin.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7585>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list