Opened 3 years ago

Closed 5 months ago

#15489 closed enhancement (duplicate)

Ajaxify Post/page trashing

Reported by: hew 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:

  1. You need a blog with enough posts or pages to give you at least two pages in the relevant administrative section.
  2. 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)

garyc40-15489.patch (9.3 KB) - added by garyc40 2 years ago.
there's a patch for that

Download all attachments as: .zip

Change History (13)

comment:1   hew3 years ago

Woops. Sorry about the lack of line breaks above.

Related: http://core.trac.wordpress.org/ticket/15488

comment:2   hew3 years ago

Doh, forgot to mention. Trunk btw.

  • 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.

comment:4   hew3 years ago

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.

comment:6 follow-up: ↓ 7   hew3 years ago

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?

comment:7 in reply to: ↑ 6   duck_3 years ago

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.

  • Description modified (diff)

garyc402 years ago

there's a patch for that

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.
  • Keywords has-patch needs-testing added

comment:11   hew2 years ago

Related to #16262?

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #12826.

Note: See TracTickets for help on using tickets.