I see this in the db log when I add the asin B0053HSZQG. While the item adds fine and I'm able to see the node (with images etc), but I'm not able to see the item in VIEWS.

Failed to insert item into amazon_item table: Message = SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'mpn' at row 1, query= INSERT INTO {amazon_item} (asin, salesrank, detailpageurl, listpriceamount, listpricecurrencycode, listpriceformattedprice, lowestpriceamount, lowestpricecurrencycode, lowestpriceformattedprice, amazonpriceamount, amazonpricecurrencycode, amazonpriceformattedprice, binding, brand, label, manufacturer, mpn, productgroup, producttypename, publisher, studio, title, customerreviews_iframe, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23) fields=
Array
(
[asin] => B0053HSZQG
[salesrank] => 666
..
..
}

Comments

rfay’s picture

Title: Failed to insert item into amazon_item table: Data too long... » amazon_item.mpn field not long enough for amazon data on some ASINs
Version: 7.x-1.0-beta6 » 7.x-1.x-dev

Looks like the mpn (manufacturer's part number?) is longer than the field provided for it in the amazon_item table. You truncated the data values so we don't know what it was.

Looks like the mpn for that item is 'Samsung i9100 Galaxy S II Unlocked GSM Smartphone with 8 MP Camera, Android OS, 16GB Internal Memory, Touchscreen, Wi-Fi, GPS - No Warranty - Black' - that's a pretty big part number!

nmridul’s picture

I have not modified anything ... its just a content type with an amazon item field and then in views I'm displaying it. I don't have anything that is modifying it (I'm not good in php and will not dare to do any such modification .... )
I imported this amazon ittem and views from another site as a features.. Will that truncate the field ?

rfay’s picture

It's currently truncating the mpn. If you don't care about the official "Manufacturer's product number" then it's not doing you any harm.

nmridul’s picture

Its ok when the node is normally viewed. The amazon image, link etc are visible. But when I create Views, none of the amazon related info is visible. No amazon image, no link .. nothing. Only what I enter for the node can be added as fields. It is working normally for other nodes that are amazon items..

rfay’s picture

That makes sense. It's failing to insert completely.

Patches are welcome. Should be pretty straightforward - widen the item in the .install's schema definition and then provide a hook_update_N() to update it.

rfay’s picture

Status: Active » Fixed
StatusFileSize
new1.2 KB

Committed this patch,
7.x: 34cb492
6.x with mods: aacdfdc

It looks like 6.x ran OK without it, as it just truncated silently instead of making a big fuss like 7.x.

You will have to run update.php

Status: Fixed » Closed (fixed)

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