Keyword

Image upload error K2.7 and J3.5

More
9 years 3 months ago #152499 by Lefteris
Replied by Lefteris on topic Image upload error K2.7 and J3.5
Hi,

The tripple equal sign operator checks a value by it's type. According to the official PHP documentation the upload errors should be integers: php.net/manual/en/features.file-upload.errors.php . So, i don't see the reason this is not working in some sites. In any case, i have applied the fix to the repository: github.com/getk2/k2/commit/6450ba69378318aeb974d2c72d8990f298f00781 .

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

More
9 years 3 months ago #152571 by Thomas Thrane
Replied by Thomas Thrane on topic Image upload error K2.7 and J3.5
I had the same issue on 2 sites.
When using PHP 7.0.4 the issue went away and things seems fine?
No need of changing the source code.

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

More
9 years 3 months ago #152579 by algerka
Replied by algerka on topic Image upload error K2.7 and J3.5
Yes, this solution is work

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

More
9 years 3 months ago #152596 by Laurent Robin
Replied by Laurent Robin on topic Image upload error K2.7 and J3.5
thanks all for the fix. had the same issue. replaced the === with == in item and category.php and it works now.

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

More
9 years 3 months ago #152598 by George Sickler
Replied by George Sickler on topic Image upload error K2.7 and J3.5
I did these fixes, and I still got this error with a box that shows up. It wont upload the images or even the item unless the extra fields box is field out with some text in the video link and slide images fields.

So I just put my titles in there and it lets me continue, but how can we fix this? I tried to upload an image, but the add file link for an attachments wont work.

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

More
9 years 3 months ago #152618 by Frédéric
Replied by Frédéric on topic Image upload error K2.7 and J3.5
Thank you (merci) for your fix...it works for me now...

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

More
9 years 3 months ago #152622 by Thomas Thrane
Replied by Thomas Thrane on topic Image upload error K2.7 and J3.5
The fix didn't work for me, but after upgrading to PHP 7.0.4. the issue was gone!

So Joomla 3.5 + K2 2.70 + PHP 7 works for me!

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

  • Litho-Verlag e.K.
  • Litho-Verlag e.K.'s Avatar
  • Offline
  • Senior Member
More
9 years 3 months ago #152756 by Litho-Verlag e.K.
Replied by Litho-Verlag e.K. on topic Image upload error K2.7 and J3.5
Hi the solution works!
But just a short question
in
/administrator/components/com_k2/models

in
item.php
and
catergory.php
I found 3 times "==="
I replaced them all with "==".

DId I do right?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #152797 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Hello Litho,

The '===' checks should be located in lines 276-279.

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

  • Litho-Verlag e.K.
  • Litho-Verlag e.K.'s Avatar
  • Offline
  • Senior Member
More
9 years 3 months ago #152888 by Litho-Verlag e.K.
Replied by Litho-Verlag e.K. on topic Image upload error K2.7 and J3.5
Hi Krikor,
thanks for your confirmation.

that's right for the item.php

but for the category.php are the lines: 86-88.

regards
Litho

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

  • Litho-Verlag e.K.
  • Litho-Verlag e.K.'s Avatar
  • Offline
  • Senior Member
More
9 years 3 months ago #152889 by Litho-Verlag e.K.
Replied by Litho-Verlag e.K. on topic Image upload error K2.7 and J3.5
And another problem exits.

The solution above works for "create a new article" in the frontend. But if I edit an existing article, K2 opens not in a new box. It will be open in the same windows and I cannot close this window with "save" or "close".

Does anybody share my problem?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #152902 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Hello,

Can you try the same with the default template?
This sounds more like a template issue.

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

More
9 years 3 months ago #152952 by Ami Ella
Replied by Ami Ella on topic Image upload error K2.7 and J3.5
Hi. I have 2 sites with K2 v2.7 on J3.5. Both are running PHP 5.6.19 on the same server.
I also confirm Miroslav solution but only for items.
It did not solve the issue in categories.
This goes for both sites.

276-279 in administrator/components/com_k2/models/item.php
Change '===' by '==' resolved the issue.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #152967 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
Thank you Ami for your feedback :)

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

  • Litho-Verlag e.K.
  • Litho-Verlag e.K.'s Avatar
  • Offline
  • Senior Member
More
9 years 3 months ago #153017 by Litho-Verlag e.K.
Replied by Litho-Verlag e.K. on topic Image upload error K2.7 and J3.5
No I cann't try it.

In backend Administrator/Components/com_k2 which folder?

In root/components/com_k2/templates/defalut/item.php I can not find a "===" triple to replace it.
and the same in the templates/mytempl/html/com_k2/templates/default/item.php

So where is it to fix?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 2 months ago #153057 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5

I fix that in item.php file (K2 administrator\components\com_k2\models) and alternated lines (around 276-279):


Or you can use the DEV version - github.com/getk2/k2/archive/master.zip

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

More
9 years 2 months ago #153747 by Alexander Elkin
Replied by Alexander Elkin on topic Image upload error K2.7 and J3.5

Miroslav wrote: 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)


It works!

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

More
9 years 2 months ago - 9 years 2 months ago #153809 by DC10555
Replied by DC10555 on topic Image upload error K2.7 and J3.5
Same issue here on 2.7 and 3.5 both fresh installations.

Thanks Miroslav! Anyone know if I can do this as an override in my template? I tried adding it to a:

TEMPLATE\html\com_k2\models\item.php

but it doesn't work..
Last edit: 9 years 2 months ago by DC10555.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 2 months ago #153827 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image upload error K2.7 and J3.5
The model cannot be overridden, but there is no reason to worry about this.
It is already included in the DEV version and it will be included in the next stable release.

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

More
9 years 2 months ago #153864 by Massimo Di Primio
Replied by Massimo Di Primio on topic Image upload error K2.7 and J3.5
Still having the infamous image was not uploaded. Please ensure that ....
The chunk of code in administrator/components/com_k2/models/item.php in my test installation is a bit different from the one mentioned by Miroslav.
This is what I've found at lines around 276-279.
if (($files['image']['error'] === 0 || $existingImage) && !JRequest::getBool('del_image'))
        {
                if ($files['image']['error'] === 0)
which does not correspond with the one mentioned in this forum.

I'm not using any other extensions, only K2.7 and J3.5.1 on.PHP 5.4.16
Anyway, trying to replae '===' with '==' does not seem to solve the issue.
Any idea?

-- Massix

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


Powered by Kunena Forum