WordPress.org

Make WordPress Core

#22725 closed defect (bug) (fixed)

Gallery Cleared Unexpectedly

Reported by: miqrogroove Owned by: koopersmith
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch commit
Focuses: Cc:

Description

To reproduce:

  1. Select images.
  2. Click Create a new gallery.
  3. Click Add to Gallery.
  4. Click Cancel Gallery.

Compare to:

  1. Select images.
  2. Click Create a new gallery.
  3. Click Add to Gallery.
  4. Click Edit Gallery.
  5. Click Cancel Gallery.

Depending on which page the user clicks Cancel Gallery, the image selection may or may not be preserved.

Attachments (1)

22725.diff (6.1 KB) - added by koopersmith 17 months ago.

Download all attachments as: .zip

Change History (11)

comment:1 miqrogroove17 months ago

Also: Any additions or edits made to the gallery will be reverted when clicking Cancel from the Edit page. So there are three different outcomes: Gallery preserved, gallery reverted, and gallery cleared.

comment:2 jeremyfelt17 months ago

Can reproduce.

First scenario in the description results in 'Create Gallery' view with no images selected. Second scenario results in 'Create Gallery' view with the original images selected.

Question is what the expected behavior should be...

comment:3 jeremyfelt17 months ago

IMO...

Images should stay selected. It's easy enough to clear the selected set if you want to redo a gallery build. If you were to accidentally hit cancel and lose your selections, that would suck more.

So, results from second scenario would be ideal.

comment:4 nacin17 months ago

  • Milestone changed from Awaiting Review to 3.5
  • Owner set to koopersmith
  • Status changed from new to assigned

koopersmith is working on smoothing over the selection sharing.

koopersmith17 months ago

comment:5 koopersmith17 months ago

  • Keywords has-patch needs-testing added

Patch improves selection sharing. It will update the relevant parts of the selection while retaining any items that are not applicable in the current view (like videos in the create gallery tab). Generally, the behavior should be sensible.

comment:6 lessbloat17 months ago

22725.diff​ works for me. +1.

comment:7 sabreuse17 months ago

The patch works for me

comment:8 helenyhou17 months ago

Another +1

comment:9 koopersmith17 months ago

  • Keywords commit added; needs-testing removed

comment:10 markjaquith17 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 23089:

New method of managing media selections. There is now a "master" selection in the background. props koopersmith. fixes #22725

  • This especially helps when you switch between insert/gallery and have non-images selected (as galleries don't support non-images).
  • The views now act as filters on the "master" selection, instead of having their own selections that get passed around.
Note: See TracTickets for help on using tickets.