Make WordPress Core

Opened 15 years ago

Closed 12 years ago

#10492 closed defect (bug) (duplicate)

Various functions using 'thumb' index to try for image metadata, 'thumbnail' would be correct

Reported by: simonwheatley's profile simonwheatley Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8.1
Component: Media Keywords: has-patch
Focuses: Cc:

Description

Both get_attachment_thumb_file, wp_delete_attachment seem to access the filename for the thumbnail attachment incorrectly; the functions try to get $imagemeta[ 'thumb ], but WP stores the filename under $imagedata[ 'sizes' ][ 'thumbnail' ][ 'file' ].

Two patches: wp_get_thumbnail_file has been tested in the course of my development, wp_delete_attachment follows the same principles of correcting the indexes and _should_ work, but hasn't been tested as I'm not using this function in my app currently and am on deadline... sorry!

Attachments (2)

wp_get_attachment_thumb_file.diff (811 bytes) - added by simonwheatley 15 years ago.
Corrects indexes to access thumbnail metadata in wp_get_thumbnail_file
wp_delete_attachment.diff (1.2 KB) - added by simonwheatley 15 years ago.
Corrects indexes to access thumbnail metadata in wp_delete_attachment

Download all attachments as: .zip

Change History (7)

@simonwheatley
15 years ago

Corrects indexes to access thumbnail metadata in wp_get_thumbnail_file

@simonwheatley
15 years ago

Corrects indexes to access thumbnail metadata in wp_delete_attachment

#1 @scribu
15 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Unassigned to 2.9
  • Version set to 2.8.1

#2 @azaozz
15 years ago

Think you're looking at the wrong place in wp_delete_attachment(). The thumbnails are deleted right under the code block you're patching. That block seems to be for back-compat with 2.3.x. Look at lines 2616 to 2622.

However only the back-compat code exist in wp_get_attachment_thumb_file(). We need to add support for the newer version there, not replace the old.

#3 @janeforshort
15 years ago

  • Milestone changed from 2.9 to Future Release

Punting as unresolved and in beta.

#4 @markoheijnen
12 years ago

  • Cc has-patch needs-testing added; has-patch needs-testing removed

If I'm right wp_get_attachment_thumb_file() is missing back compat right?

#5 @SergeyBiryukov
12 years ago

  • Cc has-patch needs-testing removed
  • Keywords needs-testing removed
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

#17262 has more traction.

Note: See TracTickets for help on using tickets.