On fresh 4.7b4 installation with amazontools from CVS HEAD.

I do create / amazon node for asin=0553377841

I get an error saying 'is already registered'. That message is printed from amazon_node_node_form_validate and it appears to me the return value from _amazon_product_db_data is not checked very well.

In the given case the return value from _amazon_product_db_data is NULL. The amazonitem table is empty. But the caller, amazon_node_node_form_validate, doesn't check for a NULL value.

CommentFileSizeAuthor
#2 AMAZONTOOLS_4-7_NODE_VALIDATION.txt543 bytesPrometheus6

Comments

reikiman’s picture

BTW, "create / amazon" works fine. It's "create / amazon node" which fails.

Prometheus6’s picture

Assigned: Unassigned » Prometheus6
StatusFileSize
new543 bytes

You are precisely correct. Thank you.

Patch attached and change committed.

Prometheus6’s picture

Status: Active » Fixed
celticess’s picture

How do I apply this patch? While I've been using linux for years now I've never had to manually use patch to fully clue into how it works.(Gentoo does it automatically from scripts on installs/updates)

I just installed Drupal 4.7 Beta 5 today and this module. I'm having the same failure. I also have to ask this because I can't tell if it's part of this general failure or not. Will this module see DVD's, CD's and Games from Amazon or is it restricted to adding purely books?(I'm hoping it will add all types as I get more of other things than books from amazon.ca)

Prometheus6’s picture

Sorry, I've been working on the HEAD branch directly. I checked and found I forgot to update the 4.7 branch a couple of times...you shouldn't have had to patch it.

I just committed the cumulative changes to the 4.7 branch.

Will this module see DVD's, CD's and Games from Amazon or is it restricted to adding purely books?

Since the node/add forms are ASIN-driven, it will actually work with whatever, with two caveats:
- There will lose possibly relevant information because the amazonitems table is designed for books. Only the fields in that table are saved.
- The search pages (search/amazon and admin/amazon_items) will only search books.

Prometheus6’s picture

Status: Fixed » Closed (fixed)