I am having an issue with a fresh install of the Amazon 6.x-1.0-beta3. I am able to find a product (ASIN 1590305590) from Administer -> Site Configuration - Amazon API -> Test. The product lookup is successful at this point. but when I go to Create Content -> Book, enter the Product ID, and save the node I get an error message back:

Amazon Product ID : No Amazon product with the ID 1590305590 could be located.

I have tried using an alternative arbitrary ASIN, 0061474096, and this one works.

Does anyone have any idea why the proper ASIN (1590305590) works on the test page, but not the node edit page?

Thanks.

Comments

devonharper’s picture

Category: support » bug

I have done a little more digging, and the problem seems to be related to the array key on line 88 of amazon\asin\asin.module. For some reason when I search for ASIN 1590305590, _asin_load_items returns a result with the incorrect array key. In this case the key is set to 0.

I performed a quick test by making a temporary modification to line 240 of the amazon/amazon.module. I commented out the array_merge command, and just returned the amazon_item_lookup_from_web() results. And the ASIN will then "work", but this will permanently ignore any of the database entries for any ASIN. I did check, and the ASIN has been entered into the database table amazon_item.

For now I have commented out and replaced line 240 of amazon/amazon.module with the following:

return $results = $items + $items_from_web;

If anyone has any suggestions at where else I can look to figure this out, it would be appreciated.

Thanks.

eaton’s picture

I'll check it out this week -- thanks for the heads up and the possible solution!

kennu’s picture

I got errors with this, and the problem was the UK locale's wrong hostname (ecs.amazonaws.uk). I changed it to ecs.amazonaws.co.uk, cleared the cache, and now it works.

lacitpo’s picture

this fix worked for me. would be nice to see this fixed in official version.

mleicester’s picture

Status: Closed (duplicate) » Active

@kennu, I think this is a separate issue. See also #303597: UK locale in install.

mleicester’s picture

Status: Active » Closed (duplicate)

This array merging issue is a duplicate of #302721: Amazon field rejects any product ID. Amazon API test feature works fine though.. I'm marking this as the duplicate because the other issue has a patch attached.

hahoangbelle’s picture

Status: Active » Closed (duplicate)

Please check the url of your main amazon by location:
http://drupal.org/node/595464#associate