Skip to:
Content

BuddyPress.org

Changeset 3844


Ignore:
Timestamp:
01/22/2011 04:35:59 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Fix single activity stream items redirecting when activity directory is off of root.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-screens.php

    r3814 r3844  
    9999
    100100    // No displayed user or not viewing activity component
    101     if ( empty( $bp->displayed_user->id ) || $bp->current_component != $bp->activity->id )
     101    if ( !bp_is_activity_component() )
    102102        return false;
    103103
    104104    // No current action or not a specific activity item
    105     if ( empty( $bp->current_action ) || !is_numeric( $bp->current_action ) )
    106         return false;
     105    if ( !bp_current_action() || !bp_is_current_action( 'p' ) || !isset( $bp->action_variables['0'] ) )
     106        return false;
     107
     108    // RE-jig the action and action variables
     109    $bp->current_action = $bp->action_variables['0'];
     110    unset( $bp->action_variables['0'] );
    107111
    108112    // Get the activity details
    109     $activity = bp_activity_get_specific( array( 'activity_ids' => $bp->current_action ) );
     113    $activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action() ) );
    110114
    111115    if ( !$activity = $activity['activities'][0] )
     
    115119    $has_access = true;
    116120
    117     // Redirect based on the type of activity
     121    // If activity is from a group, do an extra cap check
    118122    if ( isset( $bp->groups->id ) && $activity->component == $bp->groups->id ) {
    119123
    120         // This should never happen, but we'll check it anyways
     124        // Activity is from a group, but groups is currently disabled
    121125        if ( !bp_is_active( 'groups') )
    122126            bp_core_redirect( $bp->root_domain );
Note: See TracChangeset for help on using the changeset viewer.