Keyword

K2 src and cache not writing

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
7 months 4 weeks ago #172242 by Fotis
Fotis replied the topic: K2 src and cache not writing
Add a:
var_dump($handle);exit;

right after this line github.com/getk2/k2/blob/master/administrator/components/com_k2/models/item.php#L261

What's the output when you save a K2 item with an image added?

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Andrew
  • Andrew's Avatar Topic Author
  • Offline
  • New Member
More
7 months 4 weeks ago #172253 by Andrew
Andrew replied the topic: K2 src and cache not writing
Thanks Fotis, I'll try this out tomorrow. I spent a bit of time dabbling this morning and added:

294 <?php var_dump($this->row->image);

to \joomla\myblog\administrator\components\com_k2\views\item\tmpl\default.php

Notice: Undefined property: TableK2Item::$image

and could see that the $this->row->image is not populating after a save. In items (pre-update of the Joomla/server) this path had the correct url path and cached image. I could see the var_dump correctly outputting the "https..." string.

I look forward to trying out your suggestion tomorrow and reviewing the output. On a side note, I have found K2 absolutely brilliant and appreciate your help with this.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
7 months 4 weeks ago #172258 by Fotis
Fotis replied the topic: K2 src and cache not writing
You're welcome.

For the record, the var_dump I provided will show whether the upload processing PHP class has issues with the first upload after saving the item form.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Andrew
  • Andrew's Avatar Topic Author
  • Offline
  • New Member
More
7 months 4 weeks ago #172261 by Andrew
Andrew replied the topic: K2 src and cache not writing
Perfect. I've fixed it. Thanks for the information Fotis, is was enough to give me a clear picture of the problem. It is an odd bug though but I have a fix and this will be helpful for anyone else using K2 on IIS experiencing the same problem.

Okay - so, the output for an upload attempt is as follows:

object(upload)#471 (139) { ["version"]=> string(7) "0.34dev" ["file_src_name"]=> string(23) "WednesdayPres1200x720.jpg" ["file_src_name_body"]=> string(19) "WednesdayPres1200x720" ["file_src_name_ext"]=> string(3) "jpg" ["file_src_mime"]=> string(10) "image/jpeg" ["file_src_size"]=> int(105360) ["file_src_error"]=> int(0) ["file_src_pathname"]=> string(105) "D:\joomla\myblog/images\articles\events\keydates\WednesdayPres1200x720.jpg" ["file_src_temp"]=> string(0) "" ["file_dst_path"]=> string(0) "" ["file_dst_name"]=> string(0) "" ["file_dst_name_body"]=> string(0) "" ["file_dst_name_ext"]=> string(0) "" ["file_dst_pathname"]=> string(0) "" ["image_src_x"]=> int(1200) ["image_src_y"]=> int(720) ["image_src_bits"]=> int(8) ["image_src_pixels"]=> int(864000) ["image_src_type"]=> string(3) "jpg" ["image_dst_x"]=> int(1200) ["image_dst_y"]=> int(720) ["image_dst_type"]=> string(0) "" ["image_supported"]=> array(9) { ["image/gif"]=> string(3) "gif" ["image/jpg"]=> string(3) "jpg" ["image/jpeg"]=> string(3) "jpg" ["image/pjpeg"]=> string(3) "jpg" ["image/png"]=> string(3) "png" ["image/x-png"]=> string(3) "png" ["image/bmp"]=> string(3) "bmp" ["image/x-ms-bmp"]=> string(3) "bmp" ["image/x-windows-bmp"]=> string(3) "bmp" } ["file_is_image"]=> bool(true) ["uploaded"]=> bool(true) ["no_upload_check"]=> bool(true) ["processed"]=> bool(false) ["error"]=> string(35) "File too big. : 105360 > -968884224" ["log"]=> string(2263) "system information
- class version : 0.34dev
- operating system : WINNT
- PHP version : 7.1.29
- GD version : 2.1.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 3172M (3326083072 bytes)
- language : en_GB
source is a local file D:\joomla\myblog/images\articles\events\keydates\WednesdayPres1200x720.jpg
- local file OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
MAGIC path defaults to C:\Program Files (x86)\PHP\v7.1/extras/magic
Fileinfo PECL extension failed (finfo_open)
- Checking MIME type with UNIX file() command
UNIX file() command not availabled
- Checking MIME type with mime.magic file (mime_content_type())
MIME type detected as image/jpeg by mime_content_type()
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : WednesdayPres1200x720.jpg
file_src_name_body : WednesdayPres1200x720
file_src_name_ext : jpg
file_src_pathname : D:\joomla\myblog/images\articles\events\keydates\WednesdayPres1200x720.jpg
file_src_mime : image/jpeg
file_src_size : 105360 (max= 3326083072)
file_src_error : 0
- source file is an image
image_src_x : 1200
image_src_y : 720
image_src_pixels : 864000
image_src_type : jpg
image_src_bits : 8
process file to D:\joomla\myblog/media/k2/items/src\
- error: File too big. : 105360 > -968884224

As you can see, there is something going on with the handing of the megabytes (M) to bytes converstion so for the fix? I used the bytes figure (3326083072) for my php.ini file and K2 is happy again.

Fotis - thanks for your help. You're support has been superb and I am pleased to be able to keep using K2. Out of interest - is this a K2 bug?

Thanks,

Andrew

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
7 months 4 weeks ago #172262 by Fotis
Fotis replied the topic: K2 src and cache not writing
Windows never cease to amaze me... BTW, did you keep such a large upload limit?

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Andrew
  • Andrew's Avatar Topic Author
  • Offline
  • New Member
More
7 months 4 weeks ago #172265 by Andrew
Andrew replied the topic: K2 src and cache not writing
I know, it's quite a strange quirk! I'm just pleased that K2 is working well again since apart from this issue, it's been very strong and compatible with all templates I've used in the past.

I'm also hoping that this thread will help others solve their problems since it's quite a collection of troubleshooting steps and from my experience will be fine for anyone on the lastest Windows platform and version of PHP. I've checked the fix and it works on earlier versions of PHP and Windows server too.

Yes, it has a large upload limit due to the use of some rather large videos.

Judging by the PHP manual,

"When an integer is used, the value is measured in bytes", www.php.net/manual/en/ini.core.php#ini.post-max-size

so my number comes in at 3 gigbytes unless I've miscalculated.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
7 months 3 weeks ago #172275 by Fotis
Fotis replied the topic: K2 src and cache not writing
That's correct.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum