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

ahansen1’s picture

Here 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),

ahansen1’s picture

Version: 6.x-1.0-beta5 » 6.x-1.0-beta7
rfay’s picture

Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

Amazon.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.

ahansen1’s picture

Priority: Minor » Normal

I 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.

rfay’s picture

Title: Binding attribute does not come in the amazon response for some items » Remove 'not null' on items for which Amazon might not return attributes
Status: Postponed (maintainer needs more info) » Active

Ah, 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.

rfay’s picture

Status: Active » Fixed

Committed in http://drupal.org/cvs?commit=270994

Thanks,
-Randy

rfay’s picture

I'd much appreciate you testing this. Remember that you have to run update.php after installing this one, but it does nothing destructive.

Status: Fixed » Closed (fixed)

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