Opened 2 years ago
Last modified 7 weeks ago
#17736 new defect (bug)
Undefined Index in image-edit.php
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Media | Version: | 3.1.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | dromsey@… |
Description
PHP Notice: Undefined index: thumbnail in wp-admin/includes/image-edit.php on line 649
if ( $thumb = $meta['sizes']['thumbnail'] )
Attachments (2)
Change History (7)
comment:1
miqrogroove — 2 years ago
SergeyBiryukov — 20 months ago
comment:2
SergeyBiryukov — 20 months 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.
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.
- 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.
comment:5
SergeyBiryukov — 7 weeks ago
Related: #23733

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.