Форум Joomla! Україна

Повна версія: Strange problem with thumbnails
Ви переглядаєте спрощену версію. Переглянути повну версію з віповідним форматуванням.

I have a strange problem with thumbnails in module.
I have a selected "Default image if no picture found in content" in Image parameters.
Sometimes when article doesn't have a picture, module generates thumbnail from other article (usually next one by publish date) instead of using default image. Sometimes this happens and sometimes not. I didn't find pattern when this is happening.

I'm using multiple modules on home page.
I'm using latest version of module (6.4.7) on Joomla 3.4.8 on high quality VPS server.

Regards, Elvis
As I need to solve this as soon as possible, I going to dig through the code (although my dev skills are limited) and posts my findings in this thread.

First finding:
If I turn on error reporting, PHP notice is returned:
Notice: Undefined variable: _error in .../libraries/julib/image.php on line 55

Does this mean, that this condition on line 18:

if(preg_match('#^(http|https|ftp)://#i', $url)) {
    $headers = @get_headers($url);
    if(strpos($headers[0],'200')===false) $_error = 1;
} else {
    $url = JPATH_BASE .'/'. $url;
    if(!file_exists($url)) $_error = 1;

is not returning variable $_error?
Another finding: if I print or var_dump $item->imagesource or $item->image in module template file, I get valid value even for articles, that don't have images. I'm using article introtext image only.
Thnx for bugs, I'm fixed this in new version!

As I needed to solve this today, I did a little "hackish" solution, in template I'm checking if article has $item->image_intro, if not I display default image.

Looking forward for new version.