Skip to:

Re: Broken delete buttons in 1.1.3



I installed the Buddymatic theme, but get exactly the same error. The problem must be in the Buddypress core files somewhere – I had reuploaded those to make sure they are the untouched 1.1.3 files.

Any other suggestions what I could try to fix this or pinpoint the problem? This is driving me nuts…

The delete link looks like this:

<span class="activity-delete-link"><a href="" class="item-button delete-activity confirm">Delete</a></span>

When I click I get the ‘Are you sure?’ popup and then when I click OK it redirects to ‘Page not found’ with the same wpnonce URL still in the address bar.

Why? Where is it supposed to go? Which piece of code is supposed to handle this wpnonce URL?

The problem is not in the theme. I tested two clean themes, default and buddymatic. Both had the same problem.

The problem has to be in the bp core code…

The delete button is produced by this function in bp-activity-templatetags.php:

function bp_activity_delete_link() {
echo bp_get_activity_delete_link();
function bp_get_activity_delete_link() {
global $activities_template, $bp;

return apply_filters( 'bp_get_activity_delete_link', '<a href="' . wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . $activities_template->activity->id, 'bp_activity_delete_link' ) . '" class="item-button delete-activity confirm">' . __( 'Delete', 'buddypress' ) . '</a>' );

When I remove ‘confirm’ from the class, the annoying ‘Are you sure?’ popup disappears, but the page still redirects to ‘Page not found’ and the unwanted wire item is still on the page.

I assume this function only produces the link; there must be another function somewhere that is supposed to process it. Where?!

ajax.js is loaded – I double-checked… – but what is the connection between the delete link and the javascript? Is that where the processing should take place?

ajax.php has this:

<div class="wire-post-metadata">
<?php bp_wire_post_author_avatar() ?>
<?php _e( 'On', 'buddypress' ) ?> <?php bp_wire_post_date() ?>
<?php bp_wire_post_author_name() ?> <?php _e( 'said:', 'buddypress' ) ?>
<?php bp_wire_delete_link() ?>

bp_wire_delete_link, not bp_activity_delete_link…

Skip to toolbar