Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#36453 closed defect (bug) (duplicate)

Disable 'replace' button in replace media frame while attachment is uploading

Reported by: ungestaltbar Owned by:
Priority: normal Milestone:
Component: Media Version: 3.9
Severity: normal Keywords: has-patch needs-testing dev-feedback
Cc: Focuses: ui, javascript, administration

Description

Steps to reproduce:

  1. Edit a post
  2. Insert an image into the editor
  3. Click on the image and chose 'edit' (pen icon)
  4. Chose 'replace' in the dialog
  5. Upload a new image.
  6. Click on the 'replace' button while the image is still uploading

Console throws javascript error.

(possible) Solution:

Add the require option to the toolbar.items.replace button config,
around line 5082 in media-views.js

replace: {
	style:    'primary',
	text:     l10n.replace,
	priority: 80,
        requires: { selection: true },
        ....

Tested version: Version 4.5-RC1-37153

Attachments (1)

patch_36453.patch (442 bytes ) - added by shahpranaf 10 years ago.

Download all attachments as: .zip

Change History (7)

#1 @shahpranaf
10 years ago

  • Keywords has-patch needs-testing added

Hi @ungestaltbar's,

Firstly thanks for posting this bug. I followed the steps and confirm that its a bug.
And yes you were right about missing require selection option. I have fixed that bug with the patch.

Thanks

#2 @jeremyfelt
10 years ago

  • Version trunk3.9

Confirmed as well. For posterity, the error:

Uncaught TypeError: Cannot read property 'medium' of undefined in media-models.js?ver=4.5-RC2-37173-src:1072

This likely goes back to the introduction of replacing an image in the editor via [27050].

#3 @shahpranaf
10 years ago

  • Keywords dev-feedback added

#4 @shahpranaf
10 years ago

  • Focuses administration added

#5 @shahpranaf
10 years ago

Any feedback? IT would be great if we can incorporate in 4.6

#6 @wonderboymusic
9 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Duplicate of #40589.

Fixed in [40902]

Note: See TracTickets for help on using tickets.