[wp-trac] [WordPress Trac] #48710: PDF uploads are treated like images: empty alt attribute and PHP notices

WordPress Trac noreply at wordpress.org
Tue Nov 14 01:17:56 UTC 2023


#48710: PDF uploads are treated like images: empty alt attribute and PHP notices
-------------------------------------+----------------------------
 Reporter:  worddean                 |       Owner:  joedolson
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  6.5
Component:  Media                    |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:  accessibility
-------------------------------------+----------------------------
Changes (by rajinsharwar):

 * keywords:  needs-patch => needs-patch 2nd-opinion


Comment:

 So on this super OLD ticket, what I found is, this isn't really limited to
 the Image block. We can also upload PDFs in the Video block when we choose
 to add the file from the Media Library. https://prnt.sc/VbB6wxt2LxZJ

 Again, if we try to do the same by clicking the "Upload" button, then we
 cannot do that, and get an error in the snack bar saying "Sorry, this file
 type isn't supported here". https://prnt.sc/RR1E-7TbfLmZ

 So, this type of double behavior shouldn't be there as far as I think. It
 isn't logically/technically correct to add a PDF in an Image block, or a
 Video block. So, my suggestion is, to show an admin notice error when an
 unsupported file is being selected for a block from the Media Library
 popup, and block the file entry. We can show the same error like "Sorry,
 this file type isn't supported here" in an admin notice here:
 https://prnt.sc/9M2swXgNoblR when an unsupported file format is selected
 for the specific block.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48710#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list