Undefined index: thumb_hash / thumb_name / thumb_folder in Display.php

Started by Chalky, July 01, 2018, 06:32:10 AM

Previous topic - Next topic

Chalky

Hi guys, do you have any idea about these undefined index errors that are filling up my error log at an astounding rate?  SMF 2.0.15 with a million mods.


8: Undefined index: thumb_hash
File: /home/chalkcat/public_html/Sources/Display.php
Line: 1908

8: Undefined index: thumb_folder
File: /home/chalkcat/public_html/Sources/Display.php
Line: 1908

8: Undefined index: thumb_name
File: /home/chalkcat/public_html/Sources/Display.php
Line: 1908


Line 1908 is this one:

$thumb_realname = getAttachmentFilename($attachment['thumb_name'], $attachment['id_thumb'], $attachment['thumb_folder'], false, $attachment['thumb_hash']);


// Do we need to remove an old thumbnail?
if (!empty($old_id_thumb))
{
require_once($sourcedir . '/ManageAttachments.php');
removeAttachments(array('id_attach' => $old_id_thumb), '', false, false);
}
}
}
}
else
$thumb_realname = getAttachmentFilename($attachment['thumb_name'], $attachment['id_thumb'], $attachment['thumb_folder'], false, $attachment['thumb_hash']);

// Get timestamp for thumbnail image:
$time = !empty($thumb_realname) && file_exists($thumb_realname) ? filemtime($thumb_realname) : false;

// Only adjust dimensions on successful thumbnail creation.
if (!empty($attachment['thumb_width']) && !empty($attachment['thumb_height']))
{
$attachmentData[$i]['width'] = $attachment['thumb_width'];
$attachmentData[$i]['height'] = $attachment['thumb_height'];
}
}


Edited to attach the file...

GigaWatt

You're probably missing the thumbnails for some of the images that are attached in posts.

Have you ran the Attachment Integrity Check tool?

Admin --> Forum --> Attachments and Avatars --> File Maintenance

I'd do a webspace backup before doing it though ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Chalky

Thank you, I shall try that when the forum's quiet and get back to you  :)

Advertisement: