Example item:
amazon_store/item/1430228385

If you click the link that is created around the author, in the example above Todd Tomlinson, it takes you to a page:
amazon_store?Author=Todd%20Tomlinson&SearchIndex=Books

Author does not work as a variable in the search as far as I can tell, changing the Author to Keywords in the URL returns a valid search page. Same issue applies to Artist in music and possibly others I would imagine.

In amazon_store.module line 1935 changing:

    $link = l((string)$value, 'amazon_store', array('attributes' => array('rel' => 'nofollow'), 'query'=> array((string)$attributeType => (string)$value, 'SearchIndex' => $search_index)));

to:

    $link = l((string)$value, 'amazon_store', array('attributes' => array('rel' => 'nofollow'), 'query'=> array('Keywords' => (string)$value, 'SearchIndex' => $search_index)));

Seems to have the desired effect. Could someone confirm this issue and review this patch.

Thanks

Comments

the_g_bomb’s picture

Status: Active » Needs review
rfay’s picture

Status: Needs review » Closed (won't fix)

Hmm.. Author is in fact supported, and the resultant link leads to an appropriate page of results. Could you look at this again?

ItemSearch accepts Author as a parameter. And the items in the URL are processed for ItemSearch.

Placing this as "Won't Fix", but am certainly open to further conversation.

Thanks for your participation!

the_g_bomb’s picture

I have had another look and while I agree that Author, Artist etc are supported by the API, I am still having problems. Could it be that it is a Locale issue? I have my locale in the Amazon Module set to the UK.

I played around with some settings to see if it would work and managed to get it to act as expected setting the Locale to US, but only when I changed my "Default items for amazon_store page ..." to SearchIndex Only, using browsenode or a list of Amazon ASINs, seems to produce the same issue.

I am happy to look into this further myself to see if these settings could be having an effect on the results. It could also be that it is an Amazon API issue, I'll look into it.

rfay’s picture

Title: Author link from item page returns a bad search page » Author link from item page returns a bad search page when locale is set to UK
Status: Closed (won't fix) » Active

Thanks for working on this!

the_g_bomb’s picture

Title: Author link from item page returns a bad search page when locale is set to UK » Author link from item page returns a bad search page when Default items for amazon_store page is set to list of Amazon ASINs
Status: Active » Needs review
StatusFileSize
new918 bytes

Think I have finally discovered what is going on here. Just not had a lot of time to work on it recently, unfortunately.

When the "Default items for amazon_store page if no search has been done (no keywords present):" is set to: "A list of Amazon ASINs specified below"

Line 624 of the amazon_store module will always be true, even if author is set and passed in the parameters. Due to the switch statement just above it the $parameters['ItemId'] is set to the default list set in the admin settings page.

So regardless of any search made this default list will always be shown.

The attached probably isn't ideal, but seems to fix the issue on my site.

I have changed the Title of the bug to reflect a more accurate issue description.

the_g_bomb’s picture

StatusFileSize
new919 bytes

Found a typo, sorry. Use this instead

rfay’s picture

Version: 6.x-2.1 » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed to 6.x-2.x with a change to the variable name. f25948e

the_g_bomb’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.22 KB
willvincent’s picture

Status: Needs review » Fixed

This doesn't appear to have been broken on D7, but since the patch was already commit to D6, and the ported patch doesn't break anything... commit.

willvincent’s picture

Status: Fixed » Closed (fixed)