Keyword

Problem with add image from server after upgrade

More
6 years 7 months ago - 6 years 7 months ago #164089 by Igor
Hi

Try add image + save k2 item =
ERROR MESSAGE
The image was not uploaded. Please ensure that you used a valid image file and that file uploads are properly configured on your server.

====================
Image of path preset attached
imgur.com/DqOJuHX
media/library

and K2 preset
imgur.com/ih1KBYZ

With this preset Everything work ok without errors during 2 (!!!) years.

After upgrade
Joomla! 3.7.5
K2 v2.8.0

K2 Article > «Image» tab > «Browse server...» button
choose image
Save article

ERROR MESSAGE
The image was not uploaded. Please ensure that you used a valid image file and that file uploads are properly configured on your server.

imgur.com/ejoCxKY


It make false path
*SITE-ROOT-PATH*/library/images/_krok-pdf.png
In this folder no this image!

Must make this true path
*SITE-ROOT-PATH*/media/library/images/_krok-pdf.png


administrator\components\com_k2\models\item.php
Temporary fix for my preset path =
line 281

//$image = JPATH_SITE.'/'.JPath::clean($existingImage);
$image = JPATH_SITE.'/media/'.JPath::clean($existingImage);

After it fix my site work again without problem

But problem not in line 281.

Problem in input existingImage string by «Browse server...» button.

input string.JPG
Why $existingImage have
library/images/_krok-pdf.png ????

Must be real path from root joomla site =
media/library/images/_krok-pdf.png !!!!!

Please, fix this situation by use true way from non default media preset in this or new version of K2.

WBR,

Igor aka TRUEMAKER

«New projects from idea to result»
Last edit: 6 years 7 months ago by Igor. Reason: sime note edit

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 7 months ago #164105 by Krikor Boghossian
Replied by Krikor Boghossian on topic Problem with add image from server after upgrade
Hello Igor,
Does this happen with K2's media manager as well?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 7 months ago #164123 by Igor
Hi

I do not used Joomla Media Manager.
I save new images in directory by FTP program.
And this error situation for choose any image from any subfolders in server.

This error (after upgrade) K2 article (choose image from server).
And i have other subdomain with NO errors.
Different = no preset media manager path.

As result = your js take special preset path for choose image from server, but not used preset path for post string in input tag.
I think your js ignore left part of path string to "/" and post wrong path to image.
After it your php return NO IMAGE WARNING, because path is false.

You can make this situation.
Preset non default path in Joomla Media Manager (long with "/").
Save in this way new image by any components.
After it try create new K2 article by use
«Image» tab > «Browse server...» button
You will see not full path string in input tag left of button.

WBR,

Igor

«New projects from idea to result»

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 7 months ago #164142 by Krikor Boghossian
Replied by Krikor Boghossian on topic Problem with add image from server after upgrade
Hello Igor,

I will need to investigate this, is this also happening in the extrafields as well?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 6 months ago #164157 by Igor
Hi Krikor,

I did not test it (image from server) in any other K2 function.
And i used extrafields as select list or free text area only.

WBR,

Igor

«New projects from idea to result»

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 6 months ago #164167 by Krikor Boghossian
Replied by Krikor Boghossian on topic Problem with add image from server after upgrade
I will try to reproduce the issue on all scenarios and I'll let you know.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
6 years 6 months ago #164194 by Igor
Hi Krikor

I updated Joomla to 3.8.0.

Image add from server selected as before.
Only with my fix (as before)

administrator\components\com_k2\models\item.php
Temporary fix for my preset path =
line 281
//$image = JPATH_SITE.'/'.JPath::clean($existingImage);
$image = JPATH_SITE.'/media/'.JPath::clean($existingImage);

This fix need with my preset ONLY!

Image of path preset attached
imgur.com/DqOJuHX
media/library

WBR,

Igor

«New projects from idea to result»

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 6 months ago #164216 by Krikor Boghossian
Replied by Krikor Boghossian on topic Problem with add image from server after upgrade
Igor why don't you make a PR so we can evaluate it,
Once more thank you :)

github.com/getk2/k2/i

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum