Keyword

Thousands of "File does not exist" errors daily causing server allocation issues

  • joanne
  • joanne's Avatar Topic Author
  • Offline
  • Junior Member
More
6 years 7 months ago #167369 by joanne
Great, thank you for the suggestion Krikor. What do you think of this portion of code which is in the template found here: /templates/mytemplatename/code/com_k2/models

//Item image
if ($params->get('feedItemImage') && JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_'.$params->get('feedImgSize').'.jpg'))
{
$altText = $item->image_caption ? $item->image_caption : $item->title;
$item->description .= '<div class="K2FeedImage"><img src="'.JURI::root().'media/k2/items/cache/'.md5('Image'.$item->id).'_'.$params->get('feedImgSize').'.jpg" alt="'.$altText.'" /></div>';
}
The topic has been locked.
  • joanne
  • joanne's Avatar Topic Author
  • Offline
  • Junior Member
More
6 years 7 months ago #167370 by joanne
The topic has been locked.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 7 months ago #167374 by Krikor Boghossian
Hello,
Does your template override the model as well?
Also the JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_'.$params->get('feedImgSize').'.jpg')) part checks to see whether an image is actually present, so this code looks good.
Furthermore if this is a commercial template, then you can ask the template's developer for guidance.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
The topic has been locked.
  • joanne
  • joanne's Avatar Topic Author
  • Offline
  • Junior Member
More
6 years 7 months ago #167383 by joanne
Krikor, It is a custom template and I have no contact with them.
When you state: " Does your template override the model as well" - I'm unsure what you mean or where I should check for this. Would you please give me a little more info as to what to look for and where?

Thank you very much,
~J
The topic has been locked.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 7 months ago #167391 by Krikor Boghossian
I can only send you some guidance on how to locate the files you need to check
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
www.joomlaworks.net/blog/item/194-k2-inheritance-sub-templating

As for the actual code, since this is a custom template I am afraid I cannot provide any solid info.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
The topic has been locked.
  • joanne
  • joanne's Avatar Topic Author
  • Offline
  • Junior Member
More
6 years 7 months ago #167471 by joanne
Thanks Krikor, I'm continuing to troubleshoot.
The topic has been locked.
More
6 years 7 months ago #167478 by johncarter
The only thing i've done is cleared cache in the Joomla admin area for JCH Optimize Pro plugin as the site is still under development and it's necessary to do that in order to see updates.You should scan your site to see in which items the image is missing and furthermore you need to double check your template to make sure that the image is not being requested if it is not present.
The topic has been locked.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 7 months ago #167499 by Krikor Boghossian
Forgot to add, that it might be a module as well.
The K2 Content module does have the proper check but a broken override or a 3rd party module might cause this issue.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
The topic has been locked.

Powered by Kunena Forum