WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#32818 closed enhancement (fixed)

Prompt before switching comments, leaving page, updating post whilst editing a comment in the edit post screen

Reported by: polevaultweb Owned by: chriscct7
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch needs-testing
Focuses: administration Cc:
PR Number:

Description

This was proposed here https://core.trac.wordpress.org/ticket/29457#comment:4 by @chriscct7.

  1. Edit any post or page that has at least one comment in the post editor.
  2. Make changes to the comment / add new comment
  3. Attempt to leave the page in the browser, update the post, or click quick edit on another comment.
  4. The changes are lost.

We need to prompt the user that their changes will be lost and handle the response.

Similar implementation that can possibly be leveraged - https://core.trac.wordpress.org/attachment/ticket/21845/21845.3.patch

Would need to build on the solution of https://core.trac.wordpress.org/ticket/29457#comment:4 when dealing with a user updating the post during a comment edit.

Attachments (3)

32818.diff (2.7 KB) - added by polevaultweb 4 years ago.
32818.2.diff (3.1 KB) - added by polevaultweb 4 years ago.
Patch refreshed
32818.patch (2.8 KB) - added by rachelbaker 3 years ago.
Refresh with minor documentation and function name edits

Download all attachments as: .zip

Change History (11)

#1 @chriscct7
4 years ago

  • Focuses administration added
  • Version trunk deleted

#2 @chriscct7
4 years ago

  • Keywords needs-patch added

#3 @rachelbaker
4 years ago

  • Milestone changed from Awaiting Review to Future Release

Makes sense to me, moving to Future Release awaiting a patch.

@polevaultweb
4 years ago

#4 @polevaultweb
4 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

#5 @chriscct7
4 years ago

  • Owner set to chriscct7
  • Status changed from new to accepted

@polevaultweb
4 years ago

Patch refreshed

#6 @polevaultweb
3 years ago

@chriscct7 still applying cleanly - can we get into 4.6?

#7 @rachelbaker
3 years ago

  • Milestone changed from Future Release to 4.6

@rachelbaker
3 years ago

Refresh with minor documentation and function name edits

#8 @rachelbaker
3 years ago

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

In 37303:

Comments: Keep comments safe in the Edit Post screen.

Warns users that have added a new Comment or began editing an existing without saving their changes, before they press the “update” button which would wipe out their comment changes.

Fixes #32818.

Props polevaultweb.

Note: See TracTickets for help on using tickets.