- Posts: 2
COMMUNITY FORUM
Image upload error K2.7 and J3.5
- Miroslav
- Topic Author
- Offline
- New Member
Less
More
8 years 8 months ago #152417
by Miroslav
Image upload error K2.7 and J3.5 was created by Miroslav
Hi,
I had issue with uploading image to blog item.
I couldn't upload image and no error was showing in admin. This was on Joomla updated site to J3.5 and K2 was updated to v2.7 and on online hosting server. I couldn't get this error on localhost on Wamp.
I did some digging and found that problem is probably in J3.5, but I'm not 100% sure.
I fix that in item.php file (K2 administrator\components\com_k2\models) and alternated lines (around 276-279):
if (($files === 0 || $existingImage) && !JRequest::getBool('del_image'))
changed to
if (($files == 0 || $existingImage) && !JRequest::getBool('del_image'))
and
if ($files === 0)
changed to
if ($files == 0)
Not sure if this is correct, but after that I could upload image to item and didn't get any error.
Before that, I have tested K2 v2.7 on J4.8 and it is working fine online and local - I can upload image.
Uploading images on K2 v2.7 on fresh J3.5 install on local server is working as well.
Didn't have time to test fresh J3.5 install and k2 v2.7 on online server.
Also uploading video is working OK.
Maybe someone can check that code if there is not any issue.
Thanks.
I had issue with uploading image to blog item.
I couldn't upload image and no error was showing in admin. This was on Joomla updated site to J3.5 and K2 was updated to v2.7 and on online hosting server. I couldn't get this error on localhost on Wamp.
I did some digging and found that problem is probably in J3.5, but I'm not 100% sure.
I fix that in item.php file (K2 administrator\components\com_k2\models) and alternated lines (around 276-279):
if (($files === 0 || $existingImage) && !JRequest::getBool('del_image'))
changed to
if (($files == 0 || $existingImage) && !JRequest::getBool('del_image'))
and
if ($files === 0)
changed to
if ($files == 0)
Not sure if this is correct, but after that I could upload image to item and didn't get any error.
Before that, I have tested K2 v2.7 on J4.8 and it is working fine online and local - I can upload image.
Uploading images on K2 v2.7 on fresh J3.5 install on local server is working as well.
Didn't have time to test fresh J3.5 install and k2 v2.7 on online server.
Also uploading video is working OK.
Maybe someone can check that code if there is not any issue.
Thanks.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 8 months ago #152440
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Thank you for reporting this Miroslav.
We are looking into it.
We are looking into it.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Adrian
- Offline
- New Member
Less
More
- Posts: 5
8 years 8 months ago - 8 years 8 months ago #152449
by Adrian
Replied by Adrian on topic Image upload error K2.7 and J3.5
Hello,
I have the same problem. When I'm creating new article, the item image doesn't save but without any error. This is very important error for my news site.
Edit: Miroslaw, your solution is work for me, thank you :)
I have the same problem. When I'm creating new article, the item image doesn't save but without any error. This is very important error for my news site.
Edit: Miroslaw, your solution is work for me, thank you :)
Last edit: 8 years 8 months ago by Adrian.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 8 months ago #152459
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Hello Andrian,
Unfortunately I cannot verify the issue.
Which other extensions are you using?
Unfortunately I cannot verify the issue.
Which other extensions are you using?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Adrian
- Offline
- New Member
Less
More
- Posts: 5
8 years 8 months ago #152471
by Adrian
Replied by Adrian on topic Image upload error K2.7 and J3.5
I don't use any other extensions, only K2.7 and J3.5. Miroslaw's solution is works for me:
"===" changed to "==" in 2 lines in administrator/components/com_k2/models/item.php
Is this a bug in new K2?
"===" changed to "==" in 2 lines in administrator/components/com_k2/models/item.php
Is this a bug in new K2?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 8 months ago #152472
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
I cannot verify it, in my K2 sites. I am using 3.5 as well.
It could be related to a PHP version? Which PHP version are you using?
It could be related to a PHP version? Which PHP version are you using?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Adrian
- Offline
- New Member
Less
More
- Posts: 5
8 years 8 months ago #152473
by Adrian
Replied by Adrian on topic Image upload error K2.7 and J3.5
PHP 5.6 and 7... Both with problem described and solved by Miroslav. I'm not an expert, so I don't know why "==" instead "===" makes difference.
Please Log in or Create an account to join the conversation.
- Miroslav
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
8 years 8 months ago - 8 years 8 months ago #152477
by Miroslav
Replied by Miroslav on topic Image upload error K2.7 and J3.5
Hi,
I have PHP 5.4.16 on local and it is working fine.
Online server has PHP 5.4.24 and I can't upload file there.
Strange is that I can upload file via media manager or via function "Browse server" and upload image there.
So, this is way around if someone don't want change that code.
I think it is more J3.5 issue related, because as I have mentioned above, on online hosting server K2 v2.7 is working OK on J3.4.8.
Not sure but maybe clean function in input.php in libraries\joomla\filter. Didn't dig further.
I hope this helps.
I have PHP 5.4.16 on local and it is working fine.
Online server has PHP 5.4.24 and I can't upload file there.
Strange is that I can upload file via media manager or via function "Browse server" and upload image there.
So, this is way around if someone don't want change that code.
I think it is more J3.5 issue related, because as I have mentioned above, on online hosting server K2 v2.7 is working OK on J3.4.8.
Not sure but maybe clean function in input.php in libraries\joomla\filter. Didn't dig further.
I hope this helps.
Last edit: 8 years 8 months ago by Miroslav. Reason: misspelling
Please Log in or Create an account to join the conversation.
- Ivica Dajak
- Offline
- New Member
Less
More
- Posts: 6
8 years 8 months ago #152479
by Ivica Dajak
Replied by Ivica Dajak on topic Image upload error K2.7 and J3.5
Something is definitely happening with this issue.
I have numerous sites with similar setup (joomla 3.5 / k2 2.7) - I noticed this issue on one of the sites and Miroslav's fix did the trick.
However, seems that's the only site it's happening on, and I have this combination on at least dozen sites over 4 different servers. Also, I don't think it's PHP version as I have same PHP 5.4.45 on one site which has the problem, and on the other which don't.
Happy to see K2 versions moving forward, hope this issue will be fixed. I will do some further investigation myself to try to determine if it's server or joomla related issue.
I have numerous sites with similar setup (joomla 3.5 / k2 2.7) - I noticed this issue on one of the sites and Miroslav's fix did the trick.
However, seems that's the only site it's happening on, and I have this combination on at least dozen sites over 4 different servers. Also, I don't think it's PHP version as I have same PHP 5.4.45 on one site which has the problem, and on the other which don't.
Happy to see K2 versions moving forward, hope this issue will be fixed. I will do some further investigation myself to try to determine if it's server or joomla related issue.
Please Log in or Create an account to join the conversation.
- Moussa
- Offline
- New Member
Less
More
- Posts: 2
8 years 8 months ago #152485
by Moussa
Replied by Moussa on topic Image upload error K2.7 and J3.5
Joomla 3.5
k2 2.7
PHP 5.4.35
I confirm Miroslav solution.
276-279 in administrator/components/com_k2/models/item.php
Change '===' by '==' resolved the issue.
The same issue resolved in category.php
k2 2.7
PHP 5.4.35
I confirm Miroslav solution.
276-279 in administrator/components/com_k2/models/item.php
Change '===' by '==' resolved the issue.
The same issue resolved in category.php
Please Log in or Create an account to join the conversation.