#23691 closed defect (bug) (fixed)
Visiting post-new.php using the back button overwrites an existing post
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
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
@
11 years ago
So maybe it would be better to add an AYS (are you sure) if you're trying to navigate away.
#3
@
11 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
@
11 years ago
Probably some combination of headers would help, but not sure how universally reliable it is.
#7
@
9 years ago
- Milestone changed from Awaiting Review to 4.4
We can try using cookies or sessionStorage to detect when the back button was pressed, then do window.location.reload(true);
.
#8
@
9 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
@
9 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.
#10
@
9 years ago
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 33836:
I can confirm.
I think we should add an admin notice here. The title div gets cleared but the content is still there.