Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#11260 closed feature request (fixed)

Should be able to undo "Marking [comment] as Spam"

Reported by: lloydbudd Owned by:
Priority: normal Milestone: 2.9
Component: Trash Version: 2.9
Severity: normal Keywords: has-patch
Cc:

Description

Should be able to undo "Marking [comment] as Spam"

ENV: 2.9-beta-1 (TRUNK r12273)

With WP 2.9 can undo "Moving to Trash", but can't undo "Marking as Spam".

Attachments (3)

11260-first-run.diff (7.4 KB) - added by caesarsgrunt 3 years ago.
First attempt at implementing undo for spam.
11260.diff (28.2 KB) - added by caesarsgrunt 3 years ago.
Full implementation of undo for spam.
11260.2.diff (29.1 KB) - added by caesarsgrunt 3 years ago.

Download all attachments as: .zip

Change History (9)

  • Milestone changed from 3.0 to 2.9
  • Type changed from defect (bug) to feature request

Yes, I agree that this feature should be added, and I have always intended to do so when the Undo for comments has been finished. I will do so in the end. It won't be difficult, but I would rather finalise the interface for comments first so that this can be the same.

I can easily do this before the release of 2.9, and I think that would be better than waiting until 3.0, since undo for comments is already implemented in 2.9.

First attempt at implementing undo for spam.

The patch implements undo in the ajax comment interface, but not without js or for bulk.

One problem is that unlike with trash, the previous status of a spam comment isn't stored. Rather than making undo always approve the comment, which would be really confusing and annoying, I have made the js interface check whether the comment is currently approved or not when spamming the comment, and create a custom undo link based on this.

Even like this, I've had to modify admin-ajax.php and comment.php too, and it feels a bit hacky. Furthermore, it will be difficult to extend to non-js, and really difficult to extend to bulk.

I think I'll start again and just store the previous status for spam like we do for trash.

But feel free to look at and comment on the interface of the current patch...

Full implementation of undo for spam.

  • Keywords has-patch added; Spam Trash Comments removed

Latest patch fully implements undo for spam by storing the previous status, as described above.

The _wp_trash_meta_status is renamed to _wp_previous_status, and extended to work with spam too, enabling full undo for spam.

Undo for spam has the same interface as undo for trash, with minor differences.

See also #11258.

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

(In [12286]) Undo for setting a comment as spam, props caesarsgrunt, fixes #11260, see #4529

ENV: 2.9-beta-1 (trunk r12287)

Verified fix.

Note: See TracTickets for help on using tickets.