[wp-trac] [WordPress Trac] #40589: Media: Replace button enabled when no media item selected

WordPress Trac noreply at wordpress.org
Thu Apr 27 21:20:43 UTC 2017


#40589: Media: Replace button enabled when no media item selected
----------------------------+-----------------------------
 Reporter:  timmydcrawford  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Media           |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:  javascript      |
----------------------------+-----------------------------
 Initially discovered while working on the new Media Widgets for the
 customizer:
 https://github.com/xwp/wp-core-media-widgets/issues/102

 Steps to Recreate:
 - Open up a post in the editor
 - Insert an image via the "Add Media" button
 - Once the image is displayed in the editor, click the pencil icon to open
 the image editor modal
 - Click the "Replace" button below the image
 - Note the current image is selected in the replace view, and the
 "Replace" button is enabled
 - Un-select the current image so no image is selected, note the "Replace"
 button is still enabled
 - Click the "Replace" button, and an error will be thrown ( see screenshot
 )

 Some logic could be added to prevent the exception, but ideally it seems
 like the "Replace" button should be disabled when there is no active
 selection.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40589>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list