I've reduced my csv down to just 3 fields: guid, body and published. I've tried every separator, text qualifier and all i get is errors. I would appreciate any help I can get getting this content into drupal. Here's the latest error (one line for each record attempted), but they vary depending on what I try:

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'last_comment_uid' at row 1

Please, if you could look at the attached file, it owuld be greatly appreciated and any advice you could offer. The body seems to be the problem. it's encoded utf-8.

Thanks again,
Doug

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hellomobe’s picture

I'm getting a similar error. Looks like it's caused by a custom element. Any fix/config for feeds to ignore custom fields?

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'Matt' for column 'last_comment_uid' at row 1

Edit: using dev version of feeds, generic import form, HTTP Fetcher, Simple Synd. Parser, Node Processor

dotman’s picture

i've got my imports working now. Image is being fetched from remote site (so image field is populated), and my tags are being imported as individual terms into my vocabularies. so awesome. patch for terms here i think it was:

http://drupal.org/node/959984

and image field here:

http://drupal.org/node/1190868

Regarding just getting the basic text fields working, i exported my csv from MySql without a text qualifier, and made sure it was set to utf8 and unix LF. Then the basic imports started working.

Now i have to see if the user reference field works.

ShaneOnABike’s picture

I was also receiving these errors but - I figured it out!

The reason this was happening is because the original importer that I cloned had a uid element left in it. So when it's attempting to import content with a column that is missing for UID it basically fails. Ooops.

giorgio79’s picture

Title: Nothing but errors » SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'xxxx' at row 1
Priority: Normal » Major

I am getting this error message as well, and Feeds report 0 imports, yet the content is imported!

I have just a single column text file with titles. The content type has some fields (none required), and the import fails on those.

Any tips?

er_gaurav_sharma’s picture

Very simple dear your CSV file is not utf 8 encoded that is required when inserting a database record of a node

giorgio79’s picture

Thanks I tried the following in Notepad++
-convert to uft8 the encoding
-convert line endings to Unix

The error still exists unfortunately.

johnbarclay’s picture

Category: bug » support

This is an encoding problem with the text. Not a bug.

You might try html entity decode in feeds_tamper.

Even in utf8 encoded data, I always have problems with entities being in text they don't belong in. Below is a sample set from a recent project. The text going into drupal should not have the entities such as & in most fields (title, body, etc.).

    $from[] = '&';    $to[] = '&';
    $from[] = ' ';   $to[] = ' ';
    $from[] = '‘';  $to[] = "‘";
    $from[] = '’';  $to[] = "’";
    $from[] = '“';  $to[] = "“";
    $from[] = '”';  $to[] = "”";
    $from[] = '–';  $to[] = "–";
    $from[] = '—';  $to[] = "—";
    $from[] = '•';   $to[] = '•';
    $from[] = '™';  $to[] = '™';
    $from[] = '®';    $to[] = '®';
    $from[] = '©';   $to[] = '©';
    $from[] = 'é'; $to[] = 'é';
    $from[] = 'í'; $to[] = 'Í';
    $from[] = 'ñ'; $to[] = 'ñ';
    $from[] = 'í';   $to[] = 'í';
    $from[] = 'ñ';   $to[] = 'ñ';
    $from[] = ' ';   $to[] = ' '; 

    $from[] = '\x26';     $to[] = '&';
    $from[] = '\xA0';     $to[] = ' ';
    $from[] = '\x2018';   $to[] = "‘";
    $from[] = '\x2019';   $to[] = "’";
    $from[] = '\x201C';   $to[] = "“";
    $from[] = '\x201D;';  $to[] = "”";
    $from[] = '\x2013';   $to[] = "–";
    $from[] = '\x2014';   $to[] = "—";
    $from[] = '\x97';     $to[] = '—';
    $from[] = '\x2022';   $to[] = '•';
    $from[] = '\x2122';   $to[] = '™';
    $from[] = '\xA9';     $to[] = '©';
    $from[] = '\xAE';     $to[] = 'R'; 
    $from[] = '\xE9';     $to[] = 'é';
    $from[] = '\xED';     $to[] = 'í';  
    $from[] = '\x92';     $to[] = '"'; 
    $from[] = '\x93';     $to[] = '"';
    $from[] = '\xF1';     $to[] = 'ñ';
    $from[] = '\xED';     $to[] = 'í';
giorgio79’s picture

Hello,

Wanted to share my solution:

I did not have default values set for required fields. After setting those my problem went away. For me encoding was not the issue.

Andy1966uk’s picture

Can you please explain what fields and where i.e. which module etc. I have the same error and can find out what causes it..

derekw’s picture

For this particular error referencing last_comment_uid, I turned off the core Comment module during my feeds import and the error disappeared.

dooug’s picture

I am also experiencing this error when using a 7.x-2.x-dev Feed importer with FeedsNodeProcessor.

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'last_comment_uid' at row 1

I can confirm that disabling the comment module allows me to import. Although that is not an acceptable solution.

I looked into the database to found this error is happening on this table: node_comment_statistics

I discovered in my case that the error is being caused when a new nodes is being created and the function comment_node_insert() is passed a $node parameter that does not have the $node->uid set. That function is called from entity_save() in FeedsNodeProcessor.inc.

So, I proposed a patch that is a quick fix solution (at least in my case). I am not sure if this problem needs to be fixed elsewhere in the code, but my patch will ensure $entity->uid is set.

dooug’s picture

Category: support » bug
Status: Active » Needs review
dooug’s picture

updated patch to utilize entityValidate function.

emackn’s picture

Status: Needs review » Postponed (maintainer needs more info)

can you provide an import file to test this fix with. I like the change, but don't have any way to verify the change actually works before I commit this patch.

Thanks.

vogelsang’s picture

I got the problem with multiple imports as well when using the FeedsHTTPFetcher. I tried to apply the path from #11 and #13 to the FeedsHTTPFetcher, but it doesn't work for me.

I like to help out with this, but I am still quite new to Drupal coding, so I am not sure where to start (with debugging or whatever).

dooug’s picture

@vogelsang, when you say "it doesn't work for me" did you mean the patch didn't apply or the patch did apply but you still experienced errors? Are you using the latest 7.x-2.x-dev? Can you provide any example of what you are try to do?

franz’s picture

Status: Postponed (maintainer needs more info) » Needs work
giorgio79’s picture

Title: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'xxxx' at row 1 » SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'last_comment_uid' at row 1

Even better title. I am still getting this. Is it just us that face this issue?

giorgio79’s picture

Status: Needs work » Reviewed & tested by the community

Thanks, #13 patch still applies clean and works :)

dooug’s picture

I re-rolled the patch, should apply to latest 7.x-2.x-dev.

twistor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.