Hi all
I will admit I'm a little new to feeds and ubercart but I've been struggling with this for 3 days not trying to work it out and I've given up and decided to mark it as a bug.

The uc cost fiel throws an error
SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'cost' at row 1
when importing

In the has a lot in it but heres the last bit for original item

  'cost_price' => '1485.82',
  'retail_price' => '1745.84',
  'product_code' => 'PCS750217',

Now the last bit for entity,

  'filesize' => 32135,
        'display' => 1,
        'width' => 640,
        'height' => 480,
      ),
    ),
  ),
   'cost' => '',
   'sell_price' => '1745.84',
   'is_new' => true,

Notice cost is empty. I'll admit I don't understand most of the code here but I'm guessing cost should have a value like sell_price does.

If I remove the cost it imports fine (although I've removed a lot of fields while I'm testing)

Any help would be much appreciated

CommentFileSizeAuthor
#19 IMG.jpg32.8 KBmmbb
#15 Export feed configuration.txt1.65 KBmmbb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

edmonkey’s picture

any resolve on this issue?

rlustemberg’s picture

II was having the same issue. I was using the JsonPath parser. But when I went to check at the parser settings in the import form (not the parser configuration page), I saw that the fields had not been updated on the form. I put them there manually and then the issue was solved. I guess is a bug in Feeds.

Infinitee’s picture

I was getting the "SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'sell_price' at row 1" error until until I changed the delimiter setting on the Import page to "Tab".

I hope this helps the next person!

adamt19’s picture

Hi - I'm getting the same error.. some of the prices in my CSV are indeed empty but I need the CSV to import anyway. Price is not a required field. Any help appreciated..

AlfTheCat’s picture

Getting this issue too, also with CSV imports like #4. But it seems indeed that changing the separator to "TAB" fixes it, as stated in #3.

gadnis’s picture

the change of deliminator to TAB doesn't fix for me

AlfTheCat’s picture

Yeah I'm now getting it again too. I think it's because I changed from importing ASCII feeds to UTF-8. I need the latter due to transliteration issues. This brought back the error in my case.

So changing to TAB delimiter and ASCII format will probably still help those who can use that format.

Any chance of the maintainer pitching in?

AlfTheCat’s picture

Okay.. I just figured out that in my case it wasn't the UC_price field at all (but the info in my previous comment is still correct I think) however, it was a different field that contained a very strangely formatted value "M·A·C" and this caused a taxonomy field to freak out.

The node was saved but then during the process of importing the next node, apparently the error generated by my taxonomy field halted the process. As a result the import would not proceed beyond a certain percentage.`

I made a tamper for the taxonomy field, find and replace, so that M·A·C is rewritten to M.A.C. and not the import proceeds.

Hope this helps.

hanoii’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (fixed)

I don't think this is an error of this module, if the price is properly formatted, it should just work. Bear in mind that '' is not a decimal value.

I did, however make it so that empty values for prices default to 0.

mmbb’s picture

I have the same problem ("SQLSTATE [HY000]: General error: 1366 Incorrect decimal value:'' for column 'sell_price' at row 1").
I performed the solutions #3 and it didn't work, so I changed the delimiter for the other options and the same problem happened.
Does anyone have another solution?

PS: How do I test the solution #7?

(Sorry for my poor english)

hanoii’s picture

can you try the dev version?

AlfTheCat’s picture

@mmbb
You have to change this in your CSV file (UTF-8 > ASCII).

If you are on the dev version of this module, and it still happens, then probably this is the case:

Somewhere in your feed there is a character ("," or ";" or something else) that is also the seperator you configured. If you set your delimiter to ";" and the ";" character appears somewhere in a text field in your feed, then feeds will assume this marks the start of another column.
Example:
Let's say your feed is structured "title" "body" "price", and your seperator is configured to be ";".

Let's say there is a line in your feed called: Product ABC (title) - lorem ipsum; dolor amet (body) - 22,95 (price).

In this example, when the import runs, it will create a node, set the title to "Product ABC", write "lorem ipsum" to the body and then tries to enter "dolor amet" into the price field. At which point, the price field freaks out because it is expecting a number. That halts the process and Drupal will probably report that it couldn't create the next node (because the current one didn't properly complete), so it will point to the next line of your CSV file.

Converting to ASCII basically takes out the special characters. So your feed is more failsafe but as a tradeoff you don't get fancy formatted texts. Check your chosen delimiter, change it to TAB if possible, and inspect your feed for stuff that can appear to feeds like a delimiter when they are not.

Hope it helps!

mmbb’s picture

I tried the dev version and it really worked (at least doesn't give error) but it is not inserting the data from CSV file.

The test data from CSV file are:

Title,SKU,Price
ABC,2000,0.55
DEF,2001,1.55
GHI,2002,2.55

hanoii’s picture

can you export the feed import you are using to try this out?

mmbb’s picture

Sure. I uploaded a document txt with the 'export feed configuration'.
Thanks.

mmbb’s picture

any error in the feed configuration?
I appreciate any help. Thanks.

mmbb’s picture

Already solved part of the problem #13, I changed the target to "UC: Name" to "Title".
However with the following situation:
Title,SKU,Price
Product A,2001,6.11
Product B,2002,8.22
Product C,2003,10.33

Data is entered but the SKU and Price fields only enter the first digit.
Any idea what is happening?

AlfTheCat’s picture

@mmbb
You need this patch: #2256749: Only 1 character in SKU field

mmbb’s picture

FileSize
32.8 KB

I applied the patch but there was a "fatal: corrupt patch at line 14".

mmbb’s picture

mmbb’s picture

I have already solved the problem. I applied the patch manually.
Thanks.

hockey2112’s picture

I was getting the "Incorrect decimal value" error. None of the fixes worked. I uninstalled the version I was using and then installed the latest dev version from 2016. This solved the issue.