Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22714 closed defect (bug) (fixed)

Disable 'Insert gallery' and 'Set featured image' if nothing is queued

Reported by: nacin's profile nacin Owned by: koopersmith's profile koopersmith
Milestone: 3.5 Priority: normal
Severity: minor Version: 3.5
Component: Media Keywords: has-patch needs-testing commit
Focuses: Cc:

Description

  1. If you remove all images from a gallery, the "Insert gallery" button should be grayed out, forcing you to add more images or cancel it. Otherwise you end up with [gallery ids=""].
  1. You can click "Set featured image" without having selected a featured image. Again, the button should be grayed out. It closes the modal and fires an unnecessary but not damaging ajax request to delete the featured image. (The XHR returns as unsuccessful as there was nothing to delete.)

Attachments (2)

22714.diff (18.1 KB) - added by koopersmith 12 years ago.
22714.embed.diff (2.7 KB) - added by koopersmith 12 years ago.

Download all attachments as: .zip

Change History (11)

#1 @nacin
12 years ago

  • Owner set to koopersmith
  • Status changed from new to assigned

@koopersmith
12 years ago

#2 @koopersmith
12 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Patch fixes all button-state issues.

It also:

  • Updates the toolbar view to use the view manager (it was the last major holdout — this means that views in toolbars get all the benefits of view management now).
  • Updates the default option set to make the API for customizing a single-button flow *much* nicer.
  • Updates and comments the custom-background and custom-header flows.

#3 @helenyhou
12 years ago

All works well for me.

#4 @ryan
12 years ago

Looks good. Tested gallery, featured image, custom header, custom background, and some free form.

#5 @markjaquith
12 years ago

All good in my testing.

#6 @nacin
12 years ago

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

In 23024:

Media: Disable 'Insert gallery' and 'Set featured image' if nothing is queued. Converts selection toolbars to use the newer view manager. props koopersmith, fixes #22714.

#7 @koopersmith
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Update toolbars for Embed screen. Fixes JS error.

#8 @ocean90
12 years ago

  • Keywords commit added

Looks good. Uncaught TypeError: Cannot read property 'length' of undefined media-views.js:2281 is gone.

#9 @markjaquith
12 years ago

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

In 23028:

Update toolbars for Embed screen. Fixes JS error. props koopersmith. fixes #22714

Note: See TracTickets for help on using tickets.