Skip to:

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2141 closed defect (bug) (fixed)

Forum Topic delete button warning before deletion

Reported by: snark's profile snark Owned by:
Milestone: 1.2.2 Priority: major
Severity: Version:
Component: Keywords: needs-patch dev-feedback
Cc: snark


When viewing a topic or topic reply, admins see edit/delete options, as do regular members for their own posts. If a user with such privileges clicks "delete" by mistake, instead of "edit" or "#", the Topic or Reply is automatically deleted.

There should be an intermediate, "Are you sure you want to delete this Topic/Repy" message that you have to confirm to make a deletion. It's too easy now to accidentally delete your Topic or reply, and I have had user do just that.

Change History (6)

#1 @apeatling
14 years ago

  • Milestone changed from 1.2.3 to 1.2.2

#2 @cnorris23
14 years ago

  • Keywords needs-patch dev-feedback added

The problem here is in with bp-core-css-js.php with the function:

function bp_core_confirmation_js() {
	global $current_blog;

	if ( $current_blog->blog_id != BP_ROOT_BLOG )
		return false;
	<script type="text/javascript"> jQuery(document).ready( function() { jQuery("a.confirm").click( function() { if ( confirm( '<?php _e( 'Are you sure?', 'buddypress' ) ?>' ) ) return true; else return false; }); });</script>
add_action( 'wp_head', 'bp_core_confirmation_js', 100 );

The jQuery code needed to trigger the confirmation dialog is only included if the current blog being visited is the same as the root blog. I don't know if there's a particular reason for only showing it on the root blog, so I didn't write a patch. I do know that there are multiple links with the confirm class added, and they are not getting any confirmation dialog.

#3 @apeatling
14 years ago

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

(In [2827]) Fixes #2141

#4 @snark
14 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Not sure what @cnorris23 is talking about re:blogs -- the issue of this ticket is deleting FORUM topic and topic reply posts without getting a warning.

@andy -- you wrote above that it was fixed in trunk#2827, but I just installed trunk#2829 and verified that the issue still exists: one-click on the topic reply "delete" button deleted the reply, with no pop-up warning box.

#5 @apeatling
14 years ago

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

This is fixed in the 1.2 branch, not trunk.

#6 @cnorris23
14 years ago

I'm very much aware of that your ticket was about deleting a "FORUM" topic. The message was not for you -- hence the lack of @snark, or a reporter-feedback tag -- it was for the developers, to speed up the process of closing the ticket. In order for the "Are you sure?" message to appear, a particular line of javascript needs to show up on the page, in the HTML code. This is the case for every instance an "Are you sure?" message should appear. However, there was a line of code in the code posted above, this line to be specific,

	if ( $current_blog->blog_id != BP_ROOT_BLOG )
		return false;

that only allowed the javascript to be shown on one very particular blog. That's what "re:blogs" was about.

Note: See TracTickets for help on using tickets.