#23691 closed defect (bug) (fixed)
Visiting post-new.php using the back button overwrites an existing post
| Reported by: | jkudish | Owned by: | azaozz |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: | Focuses: |
Description
1) visit post-new.php
2) write a post
3) publish it
4) click back in your browser
5) write a new post
6) if you save it as draft or publish it, it will overwrite the old post
Reproducable in Firefox, Chrome and Safari.
Attachments (2)
Change History (13)
#2
@
13 years ago
So maybe it would be better to add an AYS (are you sure) if you're trying to navigate away.
#3
@
13 years ago
I guess it's happening because post-new.php makes an auto-draft and already has a post ID in a hidden input. Not sure an admin notice or an AYS can be added in this situation.
#5
@
13 years ago
Probably some combination of headers would help, but not sure how universally reliable it is.
#7
@
11 years ago
- Milestone Awaiting Review → 4.4
We can try using cookies or sessionStorage to detect when a post was published and the back button was pressed, then do window.location.reload(true);.
#8
@
11 years ago
This also happens in Press This. To reproduce:
- Go to press this url (e,g. site.domain/wp-admin/press-this.php).
- Enter some content.
- Publish. It redirects you to the new post.
- Click the back button in your browser.
- Enter some new content.
- Publish.
The previous post is overwritten.
Also reported by jkudish.
#9
@
11 years ago
- Keywords has-patch needs-testing added; needs-patch removed
Adding a query string to the current location (23691.patch) seems to force the browser to reload the page on pressing the back button.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I can confirm.
I think we should add an admin notice here. The title div gets cleared but the content is still there.