Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#27691 closed defect (bug) (fixed)

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

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

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 10 years ago.
27691-02.patch (1.6 KB) - added by gcorne 10 years ago.

Download all attachments as: .zip

Change History (7)

10 years ago

#1 @gcorne
10 years ago

  • Description modified (diff)

#2 @gcorne
10 years ago

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

10 years ago

#3 @gcorne
10 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.

10 years ago

#5 @nacin
10 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to 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.