WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 6 weeks ago

#23154 closed defect (bug) (fixed)

Media library won't display images when there's broken attachment parents

Reported by: viniciusmassuchetto Owned by: SergeyBiryukov
Priority: normal Milestone: 3.6
Component: Media Version: 3.5
Severity: normal Keywords: has-patch
Cc: kevinlangleyjr

Description

When debug is enabled and there's a problem getting the parent of an attachment, get_attachment_link will thrown a "Trying to get property of non-object" notice that breaks the JSON response of the ajax performed by the new 3.5 media library window.

Attachments (2)

23154.diff (621 bytes) - added by viniciusmassuchetto 5 months ago.
23154.2.diff (1.4 KB) - added by SergeyBiryukov 6 weeks ago.

Download all attachments as: .zip

Change History (7)

viniciusmassuchetto5 months ago

comment:1 SergeyBiryukov5 months ago

  • Component changed from General to Media
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.6

Related: #22312

comment:2 kevinlangleyjr4 months ago

  • Cc kevinlangleyjr added

comment:3 SergeyBiryukov6 weeks ago

#24258 was marked as a duplicate.

comment:4 SergeyBiryukov6 weeks ago

23154.2.diff is a patch combined with the one in #24258. Should also resolve #22312.

SergeyBiryukov6 weeks ago

comment:5 SergeyBiryukov6 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 24182:

Avoid PHP notices in Media Library if an attachment parent does not exist. props trepmal, viniciusmassuchetto, alex-ye, adamsilverstein for initial patches. fixes #22312. fixes #23154.

Note: See TracTickets for help on using tickets.