Closed (fixed)
Project:
Amazon Product Advertisement API
Version:
6.x-1.0-beta7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jan 2009 at 23:08 UTC
Updated:
18 Oct 2009 at 20:50 UTC
The binding column of the amazon_item table is defined as NOT NULL.
'binding' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE),
Try amazon ASIN item: B0002IHGYS
no binding comes back, its not a book, and I've observed that some other items just return 'Electronics'.
The insert query fails for Postgres, I've not tested mysql, but I assume that mysql inserts some sort of default on null cases.
The fix is drop the not null here or to have a default of an empty string(null is my preference).
Comments
Comment #1
ahansen1 commentedHere are a couple of other columns in the amazon_item table that are set to "not null" but are not coming back for all ASIN's (e.g. 1879268248). Actually they're not coming back for any of the ASIN's that I've migrated from my old amazon associate tools module.
'brand' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE),
'releasedate' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE),
Comment #2
ahansen1 commentedComment #3
rfayAmazon.com does not provide a consistent result on all ASINs. It's quite confusing what may and may not come back. Remember that this module is completely dependent on what they get back.
Please check the Amazon.com site and see what binding is set to.
Comment #4
ahansen1 commentedI moved the priority on this to "normal" from minor. Without this fix, there is a critical failure in the module which makes it unusable for some products. This is because the current db constraints have too many attributes marked as "not null". If those constraints are loosened to only the attributes that always come back from amazon, it will remove the issue. I looked on amazon.com and a "binding" is not listed for the products I'm trying.
Comment #5
rfayAh, I didn't understand where this bug had landed, due to the misleading title. If I understand you correctly, you think (correctly) that the database definition should be changed, and that will deal with the issue.
Comment #6
rfayCommitted in http://drupal.org/cvs?commit=270994
Thanks,
-Randy
Comment #7
rfayI'd much appreciate you testing this. Remember that you have to run update.php after installing this one, but it does nothing destructive.