Jump to content
EyeDentify

(SOLVED) Strange Error Uploading Image (SQLSTATE[01000]: Warning: 1265 Data truncated for column 'ratio' at row 1)

Recommended Posts

Posted (edited)

Hello dear PW gurus.

I have stumbled over a strange error that i all of sudden got when trying to upload an image to a images field on a page.
There where images allready stored in the field that i wanted to keep, but during the upload the error apear and after that all images are gone from the field and i can´t upload any, i just get the error every time.

I am running ProcessWire 3.0.153 dev.

Update:

After looking in the assets folder i find the folder for the page and the image files seems to be there including the ones i tried to upload when the error occured.
But they don´t show up in the images field in the page editor.

 

The error reported:
 

SQLSTATE[01000]: Warning: 1265 Data truncated for column 'ratio' at row 1

And here is a screenshot of the event:

img_upload_error.thumb.png.87f33ff8e55e4166cf60a8e79ac760cf.png

The TracyDebugger Error reporting:
tracy_Debugger_upload_image_error.thumb.png.a41846205827adc7a8303669a409dea3.png

I hope you fine folks could point me in a direction.
But it seems our old pal set_time_limit() is back.

Regards, EyeDentify

Edited by EyeDentify
Changed title to convey Solved status.

Share this post


Link to post
Share on other sites

I think this is your issue:

Is the language set to Swedish on your site? Or, on this site, do you use commas for decimals?

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, kongondo said:

I think this is your issue:

Is the language set to Swedish on your site? Or, on this site, do you use commas for decimals?

Yes Swedish, and yes commas for decimals.

Share this post


Link to post
Share on other sites

@kongondo

Why does TracyDebugger talk about set_time_limit() error in the image resizer module?

PHP Warning: set_time_limit(): Cannot set max execution time limit due to system policy in .../httpd.www/wire/core/ImageSizerEngine.php:1168

 

Share this post


Link to post
Share on other sites

@adrian and @kongondo

I did some checking and turns out i am running a Maria-DB for my PW install.
one.com does not show me what version of Maria-DB.

i also checked my config file and there i set the following locale:
 

setlocale(LC_ALL, 'sv_SE.utf8', 'sv_SE.UTF-8', 'en_US.UTF-8', 'en_US.utf8');

So what am i doing in the meantime the Imagesfield gets updated to account for this problem?

Do i have to change to English locale?
I rather not have to.

Thanks again.

Share this post


Link to post
Share on other sites

Its not a long term solution but for now i am using the files field, it at least let me upload files and output them in the template.
But ofcourse i have to do all my image resizing before upload.

I realy wish we could find a solution to this.

Share this post


Link to post
Share on other sites
1 hour ago, EyeDentify said:

I realy wish we could find a solution to this.

A bug report was filed a week ago. Ryan will get to it and sort it out, I'm sure. Meanwhile, your choices are:

  1. Downgrade your ProcessWire version.
  2. Make the manual db column type change if you can live with it.
  3. Write a hook to convert the value before it is saved  (using a period for decimals) and another hook for display (using comma for decimals) during render.
  4. If you really have to (usually not recommended), change the code in the core knowing full well this will be overwritten when you upgrade.
  • Like 2

Share this post


Link to post
Share on other sites
49 minutes ago, kongondo said:

A bug report was filed a week ago. Ryan will get to it and sort it out, I'm sure. Meanwhile, your choices are:

  1. Downgrade your ProcessWire version.
  2. Make the manual db column type change if you can live with it.
  3. Write a hook to convert the value before it is saved  (using a period for decimals) and another hook for display (using comma for decimals) during render.
  4. If you really have to (usually not recommended), change the code in the core knowing full well this will be overwritten when you upgrade.

Hello @kongondo

1. is out.
2. I am not sure how to do this whitin PW?
3. Could i get a pointer to how i should go about this?, and why is this comma usefull for an field holding images?
4. Do you know where i should start looking in the code?

In the meanwhile, guess i will have to use files fields.

Thank you.

Share this post


Link to post
Share on other sites
27 minutes ago, EyeDentify said:

and why is this comma usefull for an field holding images?

Did you get a chance to read the post I linked to? It's all explained there :-).

  • Like 2

Share this post


Link to post
Share on other sites

 

8 hours ago, EyeDentify said:

But it seems our old pal set_time_limit() is back.

This is why I keep saying that PW is not going to be compatible with one.com - there are several places in the core that use it.

  • Like 2

Share this post


Link to post
Share on other sites

 

@EyeDentify get a serious host, if you are building a serious application. The money you save on a cheap host, is wasted on time debugging various problems.

 

  • Like 3

Share this post


Link to post
Share on other sites

Ryan just pushed a fix for this 🙂 

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, eydun said:

 

@EyeDentify get a serious host, if you are building a serious application. The money you save on a cheap host, is wasted on time debugging various problems.

 

Some of us do not have that luxery sir. We have to work with what we have.

Share this post


Link to post
Share on other sites
Just now, EyeDentify said:

Some of us do not have that luxery sir. We have to work with what we have.

You can get a VPS at Linode or Digital Ocean for $5 / month. Throw Server Pilot on that and you have a great setup with all the control you need.

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, bernhard said:

Ryan just pushed a fix for this 🙂 

Sounds great 🙂 How do i apply it? Just download PW 3.0.155 dev?

9 hours ago, bernhard said:

Ryan just pushed a fix for this 🙂 

Yes @adrian i know you have been saying this and your right.
But like i said before, i can´t at the moment.

Share this post


Link to post
Share on other sites
Just now, EyeDentify said:

But like i said before, i can´t at the moment.

Fair enough - it just sounded strange to call a good host a luxury in response to Eydun's attempt to help, and also to keep bringing up that set_time_limit error. Not everyone reading this thread will know about the other thread where we figured out the cause of that error so it just confounds those trying to help you here - make sense?

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, adrian said:

Fair enough - it just sounded strange to call a good host a luxury in response to Eydun's attempt to help, and also to keep bringing up that set_time_limit error. Not everyone reading this thread will know about the other thread where we figured out the cause of that error so it just confounds those trying to help you here - make sense?

I hear you @adrian 

but i was not calling one.com luxury, it was more a saying that i did not have the luxury to change right now and have to work with what i got.

There was no ill will towards @eydun i know "he" was trying to help.

Share this post


Link to post
Share on other sites
1 minute ago, EyeDentify said:

it was more a saying that i did not have the luxury to change right now and have to work with what i got.

Sorry, I thought you were calling a "good host" a luxury.

Anyway, I am sure there are no ill feelings - sorry if I over-analyzed things 🙂

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks to @kongondo @adrian @bernhard and @eydun

That helped me with this.

Following @ryan pushing a fix for this to the PW 3.0.155 dev branch i do not have to pull my hair any longer 🙂

Also @adrian for some reason TracyDebugger is not freaking out about the Console panel anymore even after i applied 3.0.155 dev update.

Knock on wood...

Edited by EyeDentify
changed spelling misstakes.
  • Like 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By fruid
      I'm using custom fields for images (as mentioned here: processwire.com/blog/posts/pw-3.0.142) for a specific images-field, the images of which need to have an HTML-caption. It works fine so far. Now I'm trying to import pages that use this field. I first exported some pages of that kind to see what the spreadsheet would look like. It seems to not separate the captions for each images but instead put all images in one cell and all captions in another.
      How could I go about importing these pages and assign the captions to the images accordingly?
    • By picarica
      so this is really weird issue i am so confused about this, so i have setup 'images' field where i put images and the include them in CKeditor, should work right? well it works on some sites, i use it nearly in every page but at one page, the images included in that CKeditor only show up, when i am logged into processwire, when i turn on incognito mode the images dissapear, but only on this specific page, everywhere else it works perfectly, has anyone came across this issue? i have nowhere in the site login checker, i have no idea what is going on
    • By longtom
      I'm creating this site where a 'motherpage' renders all subpages.  I switched on frontend editing to make editing as easy as possible to end-users. 
      I'm stuck on adding images to the subpages.  The frontend editor suggests to add images to the motherpage (that has no images field on it, nor should it), so it asks for another page to add the images to/from. 
      Is there a way to make the frontend-editor context aware so that it looks for images in the correct subpage? 
      I already tried the 'type C' approach and added <edit field="body" page="id">, but that doesn't seem to do the trick. 
    • By picarica
      so i am trying to fetch dimensions of image using getimagesize() but it returns nothing, at least i think so, i want to feed it to data attribute, bit its emtpy, i tried feeding it the image directly or just image->url
      here is my source code

       
      foreach($page->repeat_body as $r_body) { /* other code here*/ if ($r_body->gallery_check == 1) { echo "<div class='my-gallery' id='grid-gallery' itemscope itemtype='http://schema.org/ImageGallery'>"; foreach($r_body->image as $image) { $options = array('quality' => 80, 'upscaling' => true, 'cropping' => 'north', 'sharpening'=>'medium'); $thumb = $image->size(400, 400, $options); $large = $image->size(1280, 0, $options); list($width, $height) = getimagesize($image->url); echo " <figure itemprop='associatedMedia' itemscope itemtype='http://schema.org/ImageObject'> <a href='$large->url' itemprop='contentUrl' data-size='$widthx$height' data-index='0'> <img src='$thumb->url' height='$height' width='$width' itemprop='thumbnail' alt='Beach'> </a> </figure>"; } echo "</div>"; } /* other code here*/ } now, the images are outputted correctly, i can open then and browse them
    • By Rossie
      Hi Everyone,
      I wish to display a gallery of images from multiple pages on the site.  These images have custom fields created through page reference called 'furniture_list_type'.  Each image now has a radio button which has been selected.
      In  the example code below all images appear from the "gallery20", however the selector  "gallery20.furniture_list_type=3390" does not have any effect.  "3390" is the id of the page reference "chair" selected through the page reference.  I wish only images selected as chair to show.
      Hope someone can help with this.
       
      Thanks,
       
      Calum
       
      $imagePages = $pages->find("template=makers-child, gallery20.furniture_list_type=3390") ;                     foreach($imagePages as $p) {     echo "<ul>";     foreach($p->gallery20 as $image) {         echo "<li><img src='{$image->url}'>{$image->furniture_list_type}</li>";     }     echo "</ul>";      }
×
×
  • Create New...