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
..
..
}
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | amazon.increase_mpn_length_1236890_06.patch | 1.2 KB | rfay |
Comments
Comment #1
rfayLooks 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!
Comment #2
nmridul commentedI 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 ?
Comment #3
rfayIt'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.
Comment #4
nmridul commentedIts 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..
Comment #5
rfayThat 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.
Comment #6
rfayCommitted 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