Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#27691 closed defect (bug) (fixed)

Gallery wpview throws a javascript error if an image attachment lacks metadata

Reported by: gcorne Owned by: nacin
Priority: high Milestone: 3.9
Component: Editor Version: 3.9
Severity: normal Keywords: has-patch
Cc: Focuses: javascript

Description (last modified by gcorne)

If for some reason an image used in a gallery doesn't have metadata (e.g. post meta data stored under _wp_attachment_metadata) the following javascript error will be thrown:

Uncaught TypeError: Cannot read property 'thumbnail' of undefined 

Attachments (2)

27691-01.patch​ (1.6 KB ) - added by gcorne 13 years ago.
27691-02.patch​ (1.6 KB ) - added by gcorne 13 years ago.

Download all attachments as: .zip

Change History (7)

#1 @gcorne
13 years ago

  • Description modified (diff)

#2 @gcorne
13 years ago

27961-01.patch fixes this issue by falling back to using the attachment url.

#3 @gcorne
13 years ago

27691-02.patch​ also properly escapes the src attributes.

This ticket was mentioned in IRC in #wordpress-dev by nacin. ​View the logs.


13 years ago

#5 @nacin
13 years ago

  • Owner set to nacin
  • Resolution → fixed
  • Status new → closed

In 28008:

Gallery Views: Avoid JS errors when image attachments lack metadata.

props gcorne.
fixes #27691.

Note: See TracTickets for help on using tickets.