Keyword

Image upload error K2.7 and J3.5

More
8 years 8 months ago #157099 by Ignacio Gómez
Replied by Ignacio Gómez on topic Image upload error K2.7 and J3.5
The warning "The image was not uploaded. Please ensure that you used a valid image file and that file uploads are properly configured on your server." is shown. However the rest of data and parameters are well saved.

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.

More
8 years 8 months ago #157100 by Ignacio Gómez
Replied by Ignacio Gómez on topic Image upload error K2.7 and J3.5
By the way cannot either use the "Browse the server" functionality: same warning shown (The image was not uploaded. Please ensure that you used a valid image file and that file uploads are properly configured on your server.).

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 8 months ago #157120 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Since this is a different issue can we continue our discussion here?
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.

More
8 years 8 months ago #157205 by Ignacio Gómez
Replied by Ignacio Gómez on topic Image upload error K2.7 and J3.5
Ok. Regarding the details of the php version you can find them 4 posts above on this thread. I'll try installing the DEV version of the item model. No overrides in my config, though. I'll report in www.joomlaworks.net/forum/k2-en/46400-error-k2-v2-71-frontend-after-update.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 8 months ago #157216 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Thank you Ignacio :)

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #159499 by Scott Oman
Replied by Scott Oman on topic Image upload error K2.7 and J3.5
Dear Joomlaworks Developers & Community,

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 months ago #159513 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Hello,

This fix is already present in K2''s latest stable version.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #159541 by Scott Oman
Replied by Scott Oman on topic Image upload error K2.7 and J3.5
Thanks, Krikor.

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.
Last edit: 8 years 4 months ago by Scott Oman.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 months ago #159554 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
You need to install the DEV version from github.com/getk2/k2

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #159594 by Scott Oman
Replied by Scott Oman on topic Image upload error K2.7 and J3.5
I installed K2-master (2.7.2) but the issue remains.

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 months ago #159613 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Which version of PHP are you using?

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #159625 by Scott Oman
Replied by Scott Oman on topic Image upload error K2.7 and J3.5
I am using:
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.

More
8 years 4 months ago #159685 by Scott Oman
Replied by Scott Oman on topic Image upload error K2.7 and J3.5
Hi again!

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 months ago #159692 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
I cannot reproduce the issue under PHP 5.6 unfortunately.
Are you using any other extensions, K2 related as well?

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago - 8 years 4 months ago #159697 by Scott Oman
Replied by Scott Oman on topic Image upload error K2.7 and J3.5
I'm using a lot of extensions. Using k2 comments module etc. The only non-k2 extension that is related to k2 is Je k2 Story, which allows users to submit content.

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.
Last edit: 8 years 4 months ago by Scott Oman.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #159805 by Scott Oman
Replied by Scott Oman on topic Image upload error K2.7 and J3.5
Any information about this issue?

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 months ago #159832 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
It will and you will lose bug fixes and enhancements.
You can try 2.7.0 for the time-being.

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #159924 by Scott Oman
Replied by Scott Oman on topic Image upload error K2.7 and J3.5
Yeah if I use K2 2.7.0 it solves the problem for me, but if I upgrade it comes right back. :(

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #160013 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
I have not been able to reproduce the issue under PHP 5.6.x and 7.0.x.
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.

More
8 years 2 months ago #160519 by wrina
Replied by wrina on topic Image upload error K2.7 and J3.5
Has there a solution for this problem yet.
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.


Powered by Kunena Forum