Make WordPress Core

Opened 16 years ago

Closed 14 years 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: Focuses:

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 16 years ago.
there's a patch for that

Download all attachments as: .zip

Change History (13)

#1 @hew
16 years ago

Woops. Sorry about the lack of line breaks above.

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

#2 @hew
16 years ago

Doh, forgot to mention. Trunk btw.

#3 @nacin
16 years ago

  • Milestone Awaiting Review → 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
16 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
16 years ago

  • Component General → Administration
  • Description modified (diff)
  • Keywords 3.2-early added; ajax posts pages removed
  • Milestone 3.1 → Future Release
  • Summary Post/page ajax management broken → Ajaxify Post/page trashing
  • Type defect (bug) → enhancement

Clarified ticket description.

#6 follow-up: @hew
16 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_
16 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
16 years ago

  • Description modified (diff)

@garyc40
16 years ago

there's a patch for that

#9 @garyc40
16 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
16 years ago

  • Keywords has-patch needs-testing added

#11 @hew
16 years ago

Related to #16262?

#12 @SergeyBiryukov
14 years ago

  • Milestone Future Release
  • Resolution → duplicate
  • Status new → closed

Duplicate of #12826.

Note: See TracTickets for help on using tickets.