#22607 closed defect (bug) (fixed)
Existing galleries (aka "Uploaded to this post") cannot be manually ordered
Reported by: | devinreams | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | major | Version: | 3.5 |
Component: | Gallery | Keywords: | has-patch commit |
Focuses: | Cc: |
Description (last modified by )
I'm not sure if this is worth a separate ticket and may be similar to #22488 (or may be part of a larger usability decision in #21390) but here goes: existing galleries (aka "Uploaded to this post") cannot be manually ordered which affects areas where users relied on programmatic output respecting the manual sort order of attachments to the post.
If I have a post with 5 photos uploaded and a [gallery] shortcode inline (intention: output all photos uploaded to this post), and simply want to re-order the photos, I have no discernible way to do this without inserting a new gallery shortcode to replace the existing one (with the specific id order output).
Steps:
- Upload multiple photos to a post (attached to post) and manually set a specific sort-order (likely using legacy media uploader/gallery manager)
- Insert [gallery] shortcode inline
- Open new "Insert Media" dialog
- Select "Uploaded to this post" from dropdown to show attached photos (appearing in 'gallery' shortcode)
- Attempt to drag/drop re-order the photos
Expected: sort order can be changed here in this "Uploaded to this post" view to re-order uploaded image order (without replacing shortcode).
Actual: all photos 'uploaded to this post' must be re-selected, ordered, and a new inline gallery needs to be used.
Also worth considering: some themes leveraged the "uploaded to this post" sort order (eg: a carousel at the top of the page) which can no longer be modified (AFAIK).
Attachments (4)
Change History (31)
#2
@
12 years ago
Two issues as discussed on IRC with nacin and koopersmith:
- [gallery] isn't getting upgraded properly (to some extent)
- we need to account for menu_order of images uploaded to this post
Some steps to reproduce:
- On 3.4.1 (r22873): upload 4 photos: http://d.pr/i/MPfO
- Create a manual order (different than upload order): http://d.pr/i/jyvf
- Insert [gallery] shortcode as-is: http://d.pr/i/jyvf and http://d.pr/i/7LmH
- Update WordPress trunk to 3.5-RC1 (r22873): http://d.pr/i/JVEB
- Confirm front-end gallery order output remains: (OK!)
- Confirm back-end [gallery] shortcode changed to new (NO!)
- Click "Gallery" editor (from Visual Editor) confirm order is correct (NO!): http://d.pr/i/I13H
- Change gallery order back to expected, save, confirm new gallery code (YES): http://d.pr/i/5iwE
#4
@
12 years ago
I opened #22608 for the default sort order of [gallery] not being menu_order.
This ticket can focus on allowing "Uploaded to this post" to be sortable, and for that sort to be saved to menu_order.
#7
@
12 years ago
- Cc code@… added
@devinreams and @nacin : thanks a lot for bringing this issue to the table. I would be thrilled to see this problem solved in core.
For what it's worth, I did some brainstorming about how to implement that feature and made some UI mockups here: http://ms-studio.net/notes/time-for-an-advanced-media-plugin/
Rather than adding menu_order and drag-and-drop to the Media Library view, I placed an "Attached Files" view into the left sidebar... But this was before the "Uploaded to this post" filter was added to the Media Library, so I was thinking that for a plugin it would be safer to add a new view, rather than changing the core.
A few more observations:
- It will be a bit mysterious for the user to see that the order of the images changes when switching from "All media items" to "Uploaded to this post".
- It might be unintuitive for the user that the Media Library allows drag-and-drop when the filter is "Uploaded to this post", but doesn't allow it when the filter is "All media items", "Images", "Audio" etc.
I don't see any easy solution for this, and it's a minor thing for sure - the most important to me is to have a solution for the manual re-ordering. :)
Another thing to consider: at what moment will the new order be saved? And how will the user know that the changes were saved? In 3.4, it was needed to press the "Save all changes" button. I think it's much better to save changes immediately after dragging an item, and to provide visual feedback (the flash of yellow that can be seen when changing/saving a custom field).
Btw, what about having this flash-of-yellow visual feedback also on the Title, Caption, and Alt fields when they are being saved? As per my testing, changes are always saved immediately, which is a great feature – but you can't be sure before you check the post preview ;)
One last thing: it would be lovely to see a "Invert Order" button here. When adding a large number of images, inverting the order by drag-and-drop is a tedious operation. In 3.4, we have the "Sort Order:Ascending | Descending" buttons. I find that feature useful when handling large galleries, but I think it could be simplified as one button, "Invert Order"... which would also be welcome in the "Create a new gallery" modal window.
#10
follow-up:
↓ 11
@
12 years ago
- Cc viper007bond added
Would this resolve custom galleries that rely on menu_order?
#12
@
12 years ago
Patch allows the "uploaded to this post" view to be sorted and updates "menu_order" on the server.
#14
@
12 years ago
- Keywords has-patch needs-testing added
Patch correctly updates the sort order, and will correctly update the order when new attachments are uploaded and the filter is active.
#15
@
12 years ago
Just tested 22607.3.diff - works perfectly for me. The fact that every change in the ordering is saved instantly is a huge benefit. Very relieved to see this feature added back, thanks so much!
#17
@
12 years ago
Looks great.
The only thing is, once these items have been sorted by menu_order (i.e. they're not all 0), new uploads should be added to the *end*. But, that's not how 3.4 works. It puts them all at 0, and therefore at the front, until things get moved around. In 3.5, they're put at the front but they get numbered 1-2-3 etc. We can keep that exact same behavior if we wanted if we just declined to fire refreshMenuOrder on change:uploading.
#19
@
12 years ago
- Keywords needs-patch added; has-patch needs-testing commit removed
and will correctly update the order when new attachments are uploaded and the filter is active.
So basically, removing that restores 3.4 behavior.
#20
@
12 years ago
- Keywords has-patch needs-testing added; needs-patch removed
Patch does that. Test by checking if a save-attachment-order ajax request is fired after an image is uploaded when the "uploaded to this post" filter is active.
#22
@
12 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In 22985:
#24
follow-up:
↓ 25
@
10 years ago
Has this issue regressed? Running 4.1.1 dragging items around within the Add Media dialog does nothing -- the items do not drag at all and definitely do not change menu_order.
#25
in reply to:
↑ 24
@
10 years ago
Replying to dan.rossiter:
Has this issue regressed? Running 4.1.1 dragging items around within the Add Media dialog does nothing -- the items do not drag at all and definitely do not change menu_order.
Drag-and-drop only works in "Uploaded to this post" or "Unattached" views.
#26
follow-up:
↓ 27
@
10 years ago
@SergeyBiryukov, I understand. I was testing in the "Uploaded to this post" view.
#27
in reply to:
↑ 26
@
10 years ago
Replying to dan.rossiter:
@SergeyBiryukov, I understand. I was testing in the "Uploaded to this post" view.
Feel free to create a new ticket if there's an issue. I could not reproduce it on a clean install though, drag-n-drop works as expected for me in the media dialog.
For "also worth considering," see also: http://wordpress.org/support/topic/35-rc1-menu_order-not-saved-to-the-database-for-attached-images?replies=4#post-3433325