Make WordPress Core

Opened 14 years ago

Closed 12 years ago

#15489 closed enhancement (duplicate)

Ajaxify Post/page trashing

Reported by: hew's profile hew Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords: 3.2-early has-patch needs-testing
Focuses: 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 14 years ago.
there's a patch for that

Download all attachments as: .zip

Change History (13)

#1 @hew
14 years ago

Woops. Sorry about the lack of line breaks above.

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

#2 @hew
14 years ago

Doh, forgot to mention. Trunk btw.

#3 @nacin
14 years ago

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

#4 @hew
14 years ago

Yep, you're right. It's not Ajax...sorry (my local test instance reloads so fast it throws me a bit).

#5 @scribu
14 years ago

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

#6 follow-up: @hew
14 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?

#7 in reply to: ↑ 6 @duck_
14 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.

#8 @lloydbudd
14 years ago

  • Description modified (diff)

@garyc40
14 years ago

there's a patch for that

#9 @garyc40
14 years ago

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.

#10 @garyc40
14 years ago

  • Keywords has-patch needs-testing added

#11 @hew
13 years ago

Related to #16262?

#12 @SergeyBiryukov
12 years ago

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