Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#11805 closed defect (bug) (fixed)

Can't delete alternate text from image in media library

Reported by: doug's profile doug Owned by: azaozz's profile azaozz
Milestone: 3.0 Priority: normal
Severity: minor Version: 2.9.1
Component: Media Keywords: has-patch tested
Focuses: Cc:


Steps to reproduce:

  1. Upload an image to the media library and fill in the "Alternate text" field. Save the data.
  1. In the media library, click to edit the image.
  1. Delete all text in the Alternate text field and click Update Media.
  1. In the media library, click to edit the image again and notice that the alt text has NOT been deleted.

(The same thing happens using the pop-up style media editor from within the post editor.)

Work-around: delete all text in the Alternate text field, then type a space in the field. When updating, the alt text (including the space) will be removed.

Attachments (2)

11805.patch (601 bytes) - added by reaperhulk 14 years ago.
11805.2.patch (660 bytes) - added by miqrogroove 14 years ago.
Refreshed patch file by reaperhulk

Download all attachments as: .zip

Change History (9)

#1 @scribu
14 years ago

  • Keywords needs-patch added
  • Milestone changed from Unassigned to 3.0

Confirmed in 3.0-alpha.

#2 @miqrogroove
14 years ago

Confirmed in 2.9.1.

#3 @McGurk
14 years ago

  • Cc jonathan.wilsson@… added

#4 @reaperhulk
14 years ago

  • Cc reaperhulk added
  • Keywords has-patch added; needs-patch removed

This appears to be caused by the media_upload_form_handler testing for both isset() and !empty() on the image_alt. If you remove the !empty() it behaves as expected.

Potential issue with fix: If there are any pages that use media_upload_form_handler and pass an empty string (rather than excluding image_alt entirely when they don't want to touch it) this could cause a problem.

14 years ago

#5 @miqrogroove
14 years ago

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

#6 @miqrogroove
14 years ago

  • Keywords tested added

+1 works as described, and makes sense to me.

14 years ago

Refreshed patch file by reaperhulk

#7 @dd32
14 years ago

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

(In [13283]) Allow Deletion of Media Alt text. Props reaperhulk. Fixes #11805

Note: See TracTickets for help on using tickets.