WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 months ago

#27139 reopened defect (bug)

Image caption disappears if images are rearranged immediately after adding the caption.

Reported by: cfinke Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: needs-testing, has-patch, bulk-reopened
Focuses: Cc:

Description

Steps to reproduce (screencast here: http://youtu.be/MF2SEn_lMeQ):

  1. While editing a post, open the Add Media dialog.
  2. Upload (or select) two images and choose "Create Gallery."
  3. Click "Create New Gallery".
  4. Add a caption to the first image in the text field underneath the image preview in the main "Edit Gallery" area.
  5. Drag the second image so that it is reordered in front of the first image.

What I expected:

The images would be reordered and the image captions would not be changed.

What actually happened:

The images were reordered, but the image caption I had just entered reverted to its previous state.

Clicking in any other text field before reordering images seems to "cement" the caption, but you can click on multiple images before dragging an image, and the caption will still revert.

Attachments (2)

27139.diff (510 bytes) - added by hereswhatidid 5 years ago.
Trigger blur on any inputs currently in focus when sorting is initiated.
27139.2.patch (531 bytes) - added by Fab1en 4 years ago.
Refreshing the patch. @hereswhatidid solution is still valid and work for trunk.

Download all attachments as: .zip

Change History (11)

#1 @cfinke
5 years ago

Oh, browser details: The screencast and described behavior are in Firefox 27 on Mac OS X 10.9.1.

In Chrome 32 on Mac OS X 10.9.1, the behavior is a little different: If you drag and drop the image that you just added the caption to, the caption is not lost. However, if you drag and drop another image, even if it doesn't change the location of the captioned image, the caption is lost.

#2 follow-up: @nacin
5 years ago

I'd be curious to know if this is reproducible in 3.5, or if it regressed at some point since then.

#3 in reply to: ↑ 2 @cfinke
5 years ago

Replying to nacin:

I'd be curious to know if this is reproducible in 3.5, or if it regressed at some point since then.

Yes, confirmed just now that it is reproducible in 3.5 as well.

#4 @hereswhatidid
5 years ago

This appears to be happening because the collection reset event is being triggered prior to the caption:update event. Disabling the reset fixes the issue but it's documentation alludes to the reset being needed to ensure other collections sync.

Last edited 5 years ago by hereswhatidid (previous) (diff)

@hereswhatidid
5 years ago

Trigger blur on any inputs currently in focus when sorting is initiated.

#5 @SergeyBiryukov
5 years ago

  • Version changed from 3.8.1 to 3.5

#6 @chriscct7
4 years ago

  • Keywords needs-patch needs-testing added

@Fab1en
4 years ago

Refreshing the patch. @hereswhatidid solution is still valid and work for trunk.

#7 @Fab1en
4 years ago

  • Keywords has-patch added; needs-patch removed

#8 @iseulde
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This ticket has not seen any activity in over *two* years, so I'm closing it as "wontfix".

The ticket may lack decisiveness, may have become irrelevant, or may not have gathered enough interest.

If you think this ticket does deserve some attention again, feel free to reopen.

For bugs, it would be great if you could provide updated steps to reproduce against the latest version of WordPress (5.0.2 at the time of writing). Remember images or a video can be superior to explain a problem. At the very least, quickly test again to make sure the bug still exists.

If it’s an enhancement or feature, some extra motivation may help.

Thank you for your contributions to WordPress! <3

#9 @JeffPaul
3 months ago

  • Keywords bulk-reopened added
  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened

A decision was made to reopen tickets that were closed in the bulk edit that this ticket was affected by. This ticket is being placed back into the Awaiting Review milestone so it can be individually evaluated and verified to determine if it is still relevant/valid or reproducible.

Note: See TracTickets for help on using tickets.