Opened 3 years ago
Closed 5 months ago
#15489 closed enhancement (duplicate)
Ajaxify Post/page trashing
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | 3.2-early has-patch needs-testing |
| Cc: |
Description (last modified by lloydbudd)
To reproduce:
- You need a blog with enough posts or pages to give you at least two pages in the relevant administrative section.
- Trash a post or page.
Current behaviour:
It causes a reload of the entire page and drops you back on page 1.
Expected behaviour:
Post is trashed via AJAX
Attachments (1)
Change History (13)
- Milestone changed from Awaiting Review to 3.1
The bug, I think reported elsewhere, is kicking you back to page 1. We don't have ajax trash for pages or posts, just comments, and that enhancement wasn't included in #14579, so it'll need to wait for a future release.
Yep, you're right. It's not Ajax...sorry (my local test instance reloads so fast it throws me a bit).
- Component changed from General to Administration
- Description modified (diff)
- Keywords 3.2-early added; ajax posts pages removed
- Milestone changed from 3.1 to Future Release
- Summary changed from Post/page ajax management broken to Ajaxify Post/page trashing
- Type changed from defect (bug) to enhancement
Clarified ticket description.
One note though... the current behavior (it causes a reload of the entire page and drops you back on page 1) does not occur in 3.0.1.
The entire page does reload but it stays on the page you were at.
My misdiagnosis of the Ajax angle here was a bit of a red herring and indeed an enhancement. The reload back to page 1 issue is the real bug. Nacin, did you find the other report?
Replying to hew:
My misdiagnosis of the Ajax angle here was a bit of a red herring and indeed an enhancement. The reload back to page 1 issue is the real bug. Nacin, did you find the other report?
The reload back to the first page is because these pages are now ajax-ified. I think this might be fixed in #14579 if hashes are introduced to the URLs.
Patch attached to ajaxify post/page trash/untrash/delete.
A few things to note:
- In admin-ajax.php, there's already a switch case for $_POST['action'] == 'delete-post'. The media editor is using ajax action 'delete-post', and I haven't reviewed the code to see if any other component uses 'delete-post'. In order to avoid breaking existing stuff, I named the new ajax action "delete-post-list-item".
- The javascript file that I added post trash / untrash / deletion handlers is inline-edit-post.dev.js . I think it's more proper that we rename it something like "edit-posts.dev.js", to be consistent with "edit-comments.dev.js", which does the same thing, but for comments.
comment:10
garyc40 — 2 years ago
- Keywords has-patch needs-testing added
comment:11
hew — 2 years ago
Related to #16262?
comment:12
SergeyBiryukov — 5 months ago
- Milestone Future Release deleted
- Resolution set to duplicate
- Status changed from new to closed
Duplicate of #12826.

Woops. Sorry about the lack of line breaks above.
Related: http://core.trac.wordpress.org/ticket/15488