- Posts: 10
COMMUNITY FORUM
Image upload error K2.7 and J3.5
- Ignacio Gómez
-
- Offline
- New Member
I have not found any error in the error_log.
Finally I am using a bunch of components: All Video Share, BreezingForms, JCE, Fabrik, Phoca Download, iCagenda, Localise, AcyMailing, OSMap Free, JMapMyLDAP.
Please Log in or Create an account to join the conversation.
- Ignacio Gómez
-
- Offline
- New Member
- Posts: 10
However I do not have any issue using joomla's media manager when uploading images or using them in other components.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
www.joomlaworks.net/forum/k2-en/46400-error-k2-v2-71-frontend-after-update
Furthermore can you post your PHP version and try disabling all overrides?
Finally can you try using the DEV version? github.com/getk2/k2
Please Log in or Create an account to join the conversation.
- Ignacio Gómez
-
- Offline
- New Member
- Posts: 10
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Scott Oman
-
- Offline
- Senior Member
- Posts: 66
I have had this problem for a while now but didn't get around to fixing it since it doesn't really cause any functionality problems for me. However, it is annoying and I'd like to remedy the issue if possible.
Unfortunately changing "===" to "==" in administrator/components/com_k2/models/item.php did not work for me.
I am using:
PHP 5.6.27
Joomla! 3.6.4 Stable
K2 2.7
I cannot upgrade to PHP 7.0.4. due to server restrictions.
Should I install the K2 dev version?
If so, will it override anything essential etc?
Thank you!
Kind regards,
Scott
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
This fix is already present in K2''s latest stable version.
Please Log in or Create an account to join the conversation.
- Scott Oman
-
- Offline
- Senior Member
- Posts: 66
A strange thing happened.
I downloaded and installed K2 2.7.0 from here (www.joomlaworks.net/extensions/free/k2) and the problem went away.
However, then I received a message in the K2 backend that K2 2.7.1 was available, so I followed the link, downloaded and installed K2 2.7.1.
Now the problem has returned! What should I do?
Please advise.
Kind regards,
Scott
PS: This only seems to happen in frontend editing.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Scott Oman
-
- Offline
- Senior Member
- Posts: 66
When I save in frontend editing I receive the following (even though I didn't upload anything and the k2 page looks normal):
Notice
The image was not uploaded. Please ensure that you used a valid image file and that file uploads are properly configured on your server.
Please advise.
Thank you!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Scott Oman
-
- Offline
- Senior Member
- Posts: 66
PHP 5.6.27
Joomla! 3.6.4 Stable
K2 2.7.2
I cannot upgrade to PHP 7.0.4. due to server restrictions.
Please Log in or Create an account to join the conversation.
- Scott Oman
-
- Offline
- Senior Member
- Posts: 66
Any information on this issue?
I am using:
PHP 5.6.27
Joomla! 3.6.4 Stable
K2 2.7.2
Thanks!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Are you using any other extensions, K2 related as well?
Please Log in or Create an account to join the conversation.
- Scott Oman
-
- Offline
- Senior Member
- Posts: 66
But as mentioned, when I installed the latest k2 2.7.0 , the issue went away.
It came back after installing 2.7.1 and remained after installing the dev version.
Can I just reinstall the latest 2.7.0 version?
Or do you have other ideas?
I can pm you login credentials if you'd like to check yourself.
Thanks.
Please Log in or Create an account to join the conversation.
- Scott Oman
-
- Offline
- Senior Member
- Posts: 66
Can I just reinstall the k2 2.7.0 version?
Will it override the dev version?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
You can try 2.7.0 for the time-being.
Please Log in or Create an account to join the conversation.
- Scott Oman
-
- Offline
- Senior Member
- Posts: 66
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Sadly without being able to reproduce the issue (2.7.1 and 2.7.2) I cannot provide a solution.
Please Log in or Create an account to join the conversation.
- wrina
-
- Offline
- New Member
- Posts: 8
I have K2 v2.7.1
Joomla 3.6.5
I am not able to save images.
I have reviewed the fix: www.joomlaworks.net/forum/k2-en/45116-image-upload-error-k2-7-and-j3-5
My system file is not the same, however I still have the problem. What is the edit to the item.php file to ensure images are saved to the database?? ::
//Image
if ((int)$params->get('imageMemoryLimit'))
{
ini_set('memory_limit', (int)$params->get('imageMemoryLimit').'M');
}
$existingImage = JRequest::getVar('existingImage');
if (($files == 0 || $existingImage) && !JRequest::getBool('del_image'))
{
if ($files == 0)
{
$image = $files;
}
else
{
$image = JPATH_SITE.DS.JPath::clean($existingImage);
}
$handle = new Upload($image);
$handle->allowed = array('image/*');
$handle->forbidden = array('image/tiff');
if ($handle->file_is_image && $handle->uploaded)
{
//Image params
$category = JTable::getInstance('K2Category', 'Table');
$category->load($row->catid);
$cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
if ($cparams->get('inheritFrom'))
{
$masterCategoryID = $cparams->get('inheritFrom');
$query = "SELECT * FROM #__k2_categories WHERE id=".(int)$masterCategoryID;
$db->setQuery($query, 0, 1);
$masterCategory = $db->loadObject();
$cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
}
$params->merge($cparams);
//Original image
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'src';
$handle->image_convert = 'jpg';
$handle->jpeg_quality = 100;
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = md5("Image".$row->id);
$handle->Process($savepath);
$filename = $handle->file_dst_name_body;
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache';
//XLarge image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XL';
if (JRequest::getInt('itemImageXL'))
{
$imageWidth = JRequest::getInt('itemImageXL');
}
else
{
$imageWidth = $params->get('itemImageXL', '800');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//Large image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_L';
if (JRequest::getInt('itemImageL'))
{
$imageWidth = JRequest::getInt('itemImageL');
}
else
{
$imageWidth = $params->get('itemImageL', '600');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//Medium image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_M';
if (JRequest::getInt('itemImageM'))
{$imageWidth = JRequest::getInt('itemImageM');}
else
{
$imageWidth = $params->get('itemImageM', '400');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//Small image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_S';
if (JRequest::getInt('itemImageS'))
{
$imageWidth = JRequest::getInt('itemImageS');
}
else
{
$imageWidth = $params->get('itemImageS', '200');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//XSmall image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XS';
if (JRequest::getInt('itemImageXS'))
{
$imageWidth = JRequest::getInt('itemImageXS');
}
else
{
$imageWidth = $params->get('itemImageXS', '100');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//Generic image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_Generic';
$imageWidth = $params->get('itemImageGeneric', '300');
$handle->image_x = $imageWidth;
$handle->Process($savepath);
if ($files == 0)
$handle->Clean();
}
else
{
$mainframe->enqueueMessage(JText::_('K2_IMAGE_WAS_NOT_UPLOADED'), 'notice');
}
}
if (JRequest::getBool('del_image'))
{
$current = JTable::getInstance('K2Item', 'Table');
$current->load($row->id);
$filename = md5("Image".$current->id);
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'src'.DS.$filename.'.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'src'.DS.$filename.'.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XS.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XS.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_S.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_S.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_M.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_M.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_L.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_L.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XL.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XL.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_Generic.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_Generic.jpg');
}
$row->image_caption = '';
$row->image_credits = '';
}
Please Log in or Create an account to join the conversation.