Make WordPress Core

Opened 15 years ago

Closed 12 years ago

Last modified 12 years ago

#17736 closed defect (bug) (fixed)

Undefined Index in image-edit.php

Reported by: miqrogroove Owned by: wonderboymusic
Priority: normal Milestone: 4.0
Component: Media Version: 3.1.3
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

PHP Notice: Undefined index: thumbnail in wp-admin/includes/image-edit.php on line 649

			if ( $thumb = $meta['sizes']['thumbnail'] )

Attachments (2)

17736.patch (638 bytes ) - added by SergeyBiryukov 15 years ago.
17736.2.diff (615 bytes ) - added by MikeHansenMe 14 years ago.
refreshed patch

Download all attachments as: .zip

Change History (10)

#1 @miqrogroove
15 years ago

I used the "scale image" option to change an image from 256x300 to a height of 150 and whatever the default width was. After doing so, there was no thumbnail and the editor started bugging out on me. I think that's when the notices were logged.

#2 @SergeyBiryukov
15 years ago

  • Keywords has-patch added

A !empty() check probably wouldn't hurt.

I couldn't reproduce the issue though. The notice means that there's no thumbnail for the image, while "Thumbnail Settings" block with target selection is only displayed when the thumbnail is present.

Perhaps the image metadata was malformed? In that case, the issue might be deeper.

#3 @dimitrov.adrian
15 years ago

I tried and reproduced such problem (on wordpress daily build) when i moving a website from one host to other, but the interesting is that i just copy the databases, not using the importer/exporter plugins.

#4 @goto10
14 years ago

  • Cc dromsey@… added

I ran into the same issue. Sergey's fix worked for me. I did some debugging and noticed that the sizes element was set to an empty array. (I saved $meta to a row in the options table, since I wasn't sure how else to see the value, being that we're in ajax mode at this point during execution). Unfortunately, I'm not sure why the sizes are all gone.

@MikeHansenMe
14 years ago

refreshed patch

#6 @kirasong
13 years ago

  • Milestone Awaiting ReviewFuture Release

#7 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolutionfixed
  • Status newclosed

In 28366:

Avoid a notice in wp_save_image() by checking $meta['sizes']['thumbnail'] for ! empty() before setting a variable to it.

Props MikeHansenMe.
Fixes #17736.

#8 @wonderboymusic
12 years ago

  • Milestone Future Release4.0
Note: See TracTickets for help on using tickets.