[buddypress-trac] [BuddyPress] #2692: Lines order in ajax.php - bp_dtheme_delete_activity()
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Thu Oct 28 10:47:28 UTC 2010
#2692: Lines order in ajax.php - bp_dtheme_delete_activity()
-----------------------+----------------------------------------------------
Reporter: calvin_42 | Owner:
Type: defect | Status: new
Priority: trivial | Milestone: 1.2.7
Component: Theme | Keywords:
-----------------------+----------------------------------------------------
Hi there!
There is a minor glitch in
[http://trac.buddypress.org/browser/branches/1.2/bp-themes/bp-
default/_inc/ajax.php ajax.php]. See bp_dtheme_delete_activity() (line
205).
Original :
{{{
$activity = new BP_Activity_Activity( $_POST['id'] );
/* Check access */
if ( !is_site_admin() && $activity->user_id != $bp->loggedin_user->id )
return false;
if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) )
return false;
/* Call the action before the delete so plugins can still fetch
information about it */
do_action( 'bp_activity_action_delete_activity', $_POST['id'],
$activity->user_id );
if ( !bp_activity_delete( array( 'id' => $_POST['id'], 'user_id' =>
$activity->user_id ) ) ) {
echo '-1<div id="message" class="error"><p>' . __( 'There was a
problem when deleting. Please try again.', 'buddypress' ) . '</p></div>';
return false;
}
}}}
Should be :
{{{
if ( empty( $_POST['id'] ) || !is_numeric( $_POST['id'] ) )
return false;
$activity = new BP_Activity_Activity( $_POST['id'] );
/* Check access */
if ( !is_site_admin() && $activity->user_id != $bp->loggedin_user->id )
return false;
/* Call the action before the delete so plugins can still fetch
information about it */
do_action( 'bp_activity_action_delete_activity', $activity->id,
$activity->user_id );
if ( !bp_activity_delete( array( 'id' => $activity->id, 'user_id' =>
$activity->user_id ) ) ) {
echo '-1<div id="message" class="error"><p>' . __( 'There was a
problem when deleting. Please try again.', 'buddypress' ) . '</p></div>';
return false;
}
}}}
--
Ticket URL: <https://trac.buddypress.org/ticket/2692>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list