Skip to:
Content

BuddyPress.org

Opened 12 years ago

Last modified 8 years ago

#4458 reopened defect (bug)

Activity update deletion and the "Are you sure" dialog box

Reported by: tifire's profile tifire Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Activity Keywords: dev-feedback needs-patch
Cc:

Description

I assume the "Are you sure" dialog box is required for every activity update deletion, so I think this is a buddypress bug.

I have tested this on testbp.org. Here is what I found:
1) Right after posting an activity update, no "Are you sure" dialog box shows up if I click the "delete" button. The activity update is just deleted.
2) After posting an activity update, if I refresh the page then click the "delete" button, the "Are you sure" dialog box shows up for me to confirm the deletion.
3) If I refresh the page, select any of the filter ( everything, updates, new groups, group memberships, etc), all my activity updates can be just deleted without seeing the "Are you sure" dialog box.

Attachments (1)

4458.diff (1.2 KB) - added by boonebgorges 12 years ago.

Download all attachments as: .zip

Change History (12)

#1 @DJPaul
12 years ago

  • Milestone changed from Awaiting Review to 1.7
  • Severity changed from critical to normal

Confirmed on testbp which is currently running 1.6.

#2 @boonebgorges
12 years ago

  • Keywords dev-feedback added

What's our policy on fixing this kind of issue for bp-default/bp-legacy?

#3 @DJPaul
12 years ago

The issue is the jQuery is bound to DOM elements that exist at page load time. Elements added in later aren't bound to the click detection, so our message box doesn't appear. If this can be fixed without a huge rewrite of BP-Default's JS, I say we should do it -- ideally we not to ought have differing behaviour for the "same" button.

#4 @boonebgorges
12 years ago

Right. In the rest of the activity stream, we use proper delegation. But in the case of our .confirm js, it's printed in the document head, with bp_core_confirmation_js(). Something like 4458.diff should work, in theory. I had to change the priority to 1 so that it was printed before the main site scripts, otherwise it wouldn't fire in time. Still, there's a race condition somewhere that's causing the confirm script not to fire in all cases. If anyone has any bright ideas....

FWIW this is not a bp-default issue, as we print this bit of script in core.

@boonebgorges
12 years ago

#5 @johnjamesjacoby
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6597]) Fix bug with confirm JS not working on AJAX refreshed activity streams. Props boonegorges. Fixes #4458.

#6 @boonebgorges
12 years ago

(In [6809]) Don't use event delegation in bp_core_confirmation_js()

Event bubbling prevents the JS confirm dialog from working properly.

This commit reverts changes introduced in #6597. See #4458

Fixes #4843. Props sbrajesh

#7 @boonebgorges
12 years ago

  • Milestone changed from 1.7 to Future Release
  • Resolution fixed deleted
  • Status changed from closed to reopened

The delegation solution won't work globally. See #4843. We're going to have to live with this bug for now.

#8 @vhauri
11 years ago

This could probably be fixed by changing some return false; statements to e.preventDefault();

For example, line 169 of bp-themes/bp-default/_inc/global.js uses a return false; which will definitely break bubbling, but that's exactly what the jQuery method's for. If this is a lost cause, please let me know, otherwise I'll happily whip up a quick patch.

#9 @boonebgorges
11 years ago

  • Keywords needs-patch added

vhauri - Absolutely, please do write a patch. Could you please patch against bp-templates/bp-legacy/js/buddypress.js? bp-default is being EOLed.

#10 @tw2113
8 years ago

@boonebgorges @hnla with the bp-nouveau work going on, would this potentially be an obsolete ticket?

#11 @hnla
8 years ago

Nouveau JS handles this correctly, I'm inclined to close this ticket due to age and lack of suggested patch forthcoming & fact we have lived with this minor issue for this long.

For the sake of it I just tried patching, can add e.preventDefault(); and that does at least allow the success message to be returned, but figuring out a confirm dialogue without also running the default one escapes me & haven't really further time to lend to this.

Note: See TracTickets for help on using tickets.