Ticket #6815 (closed enhancement: fixed)

Opened 7 months ago

Last modified 1 month ago

Batch editing for posts

Reported by: matt Assigned to: ryan
Priority: normal Milestone: 2.7
Component: Administration Version: 2.5
Severity: normal Keywords: blessed
Cc:

Description

One of the things in the original HC mockup that was cut from 2.5 was batch editing of posts, meant to provide a way to edit titles, tags, categories, publish state, and author in a batch fashion from the edit screen.

First we need some mockups of how this should work, which should be attached to this ticket, and then we can work on getting it in.

Attachments

manageable.patch (27.9 kB) - added by aaron_guitar on 09/01/08 06:00:22.
Initial integration of Manageable. Saving not yet implemented.
6815.diff (28.5 kB) - added by ryan on 09/03/08 06:17:19.
6815.2.diff (28.7 kB) - added by aaron_guitar on 09/10/08 16:39:21.
Integration of manageable with saving

Change History

04/25/08 17:21:01 changed by ryan

Plugin that does batch editing of categories.

http://robm.me.uk/projects/plugins/wordpress/batch-categories

04/25/08 17:45:42 changed by intoxination

Here's a plugin that allows ajax editing of comments from the manage posts screen:

http://uwmike.com/wordpress/wp-cats/

I did something similar about a year ago, hacking the manage screen. It was rather simple. The edit.php screen had hidden divisions for categories, author and the date picker. Clicking on a certain cell would attach that hidden division to that cell so you could change it (ie: click on categories would attach the floating category drop down list and show it). Once you clicked to close it, the changes were saved via AJAX.

For titles I simply made it an edit in place. A similar approach should work here. The javascript side of it should actually be a little simpler now, as jQuery 1.2.x has methods built in to get the offset of an element, which makes it easy for positioning.

07/31/08 21:30:04 changed by ryan

  • milestone changed from 2.9 to 2.7.

08/01/08 23:03:27 changed by ryan

09/01/08 05:57:51 changed by aaron_guitar

A few issues that need to be sorted out. First, the page's children need to somehow be removed from the page parent dropdown. I'm not sure how the child pages would be distinguished using just JS. Second, I'm not sure how to best collect the mass of post data and make the Ajax request to save everything. We could give each of the input fields a name like "title-ID" and use the jQuery form plugin to serialize the fields. That's just a lot to sort through on the PHP side. I can't think of any other options though.

09/01/08 06:00:22 changed by aaron_guitar

  • attachment manageable.patch added.

Initial integration of Manageable. Saving not yet implemented.

09/01/08 06:15:57 changed by aaron_guitar

Shift change functionality has been setup. If you have multiple edit rows open and hold shift while changing a select field or clicking a checkbox, the change will be made to each of the open rows. The button may need to be changed from shift to Command/Ctrl because Shift does some funky text selection stuff. Batch editing text fields is a little trickier. For now I've set it up so that if you hold shift while blurring the text field all the open rows are changed. I'm not sure how intuitive that is but again, I don't have any better ideas.

(follow-up: ↓ 8 ) 09/02/08 07:01:33 changed by azaozz

At the moment this patch tries to do both quick editing and batch editing at the same time. Perhaps we should split them in separate tasks: quick edit on per post basis (one post only) could potentially include the content too, would be something similar to the quick press on the dashboard.

Batch editing would be available from the "Actions" drop-down, would open one editing dialog and add the selected posts (selectable with the checkboxes), then allow editing of timestamp, author, category, tag and publish status for all the posts at the same time, setting the same values. That IMHO is what's expected from batch processing. Of course there will be a way to choose which values are to be edited.

(in reply to: ↑ 7 ) 09/02/08 16:42:30 changed by aaron_guitar

That sounds like a sensible way of setting it up. I was just trying to combine interfaces so users wouldn't have to bounce between two different interfaces to make quick edits to single or multiple posts. Let me know what the next steps should be.

09/02/08 23:22:12 changed by ryan

Splitting quick and batch edit sounds good. Let's focus on nailing down quick edit first.

Right now, I'm getting three inline-data AJAX requests when loading the pages or posts. Clicking "Quick Edit" results in three edit fields popping up. This is with FF and Safari.

(follow-up: ↓ 12 ) 09/03/08 06:12:30 changed by aaron_guitar

Something must have gone awry in the transfer. Only one Ajax request should be made on load and obviously only one edit row should popup. I'll go ahead and finish out implementation (with saving and no batch editing) and upload a new diff.

09/03/08 06:16:42 changed by ryan

I fixed it with document ready. I also fixed some PHP warnings in get_edit_data() and display_edit_row() for using uninitialized variables.

09/03/08 06:17:19 changed by ryan

  • attachment 6815.diff added.

(in reply to: ↑ 10 ) 09/03/08 07:01:22 changed by azaozz

Replying to aaron_guitar:

I'll go ahead and finish out implementation (with saving and no batch editing) and upload a new diff.

Good to know so we don't duplicate. Can do the styling after. Perhaps we need to add a hook too so plugins can customize it.

09/10/08 16:39:21 changed by aaron_guitar

  • attachment 6815.2.diff added.

Integration of manageable with saving

09/10/08 17:32:20 changed by aaron_guitar

Just posted final integration of Manageable. I haven't done too much cross-browser checking. I do know that Safari has issues updating the postXml variable after saving. I'm using jQuery's replaceWith method so this might be an issue with jQuery.

I'll let you guys take it from here. Let me know if you have any questions.

09/10/08 22:47:05 changed by ryan

(In [8857]) Inline editing. First cut. Props Aaron Harp. see #6815

09/10/08 22:49:46 changed by ryan

It's in. I made some API changes to edit_post(), post_rows(), and _wp_translate_postdata() so you could pass the data along instead of having to fuss with globals. I reverted the taxonomy.php change since adding a space after the comma breaks other things. Looks like this broke tags editing in quick edit, so that will need attention.

09/11/08 00:53:09 changed by thee17

The plugin "Admin Management Xtended" seems to have a more elegant user-friendly interface. Just a thought for consideration.

09/11/08 05:50:19 changed by ryan

(In [8861]) Don't assign default to pass-by-ref var. Not compatible with all PHP versions. see #6815

09/12/08 00:49:07 changed by aaron_guitar

One thing that should probably be thought about is how revisions are handled on inline edits.

09/17/08 11:32:34 changed by azaozz

(In [8917]) Add nonces to quick edit, see #6815

09/21/08 19:45:46 changed by azaozz

(In [8943]) Sytling and improvements to inline editing, see #6815

09/25/08 13:42:35 changed by azaozz

(In [8973]) Batch editing, first cut, see #6815

09/25/08 14:29:32 changed by azaozz

(In [8976]) Batch editing, refresh JS and CSS, see #6815

09/25/08 23:07:20 changed by aaron_guitar

With the bulk edit it is possible to change a page to be its own parent. I just did this and it locked up Apache and I had to restart it.

The styling looks good. I just don't like that it takes up so much of the screen real estate. I know it's not my thing anymore, but I thought I'd throw that out there.

09/30/08 10:41:02 changed by azaozz

Page parents should be fixed in [9036]. Yes it takes more screen space, but allows for only one editing row at a time either quick edit or batch edit. Also some boxes can be hidden from the page column settings.

10/02/08 20:45:48 changed by aaron_guitar

Cool. It's growing on me.

10/14/08 21:18:05 changed by matt

  • status changed from new to closed.
  • resolution set to fixed.

Seems to work well, let's put bugs in new tickets.