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
Comment #1
the_g_bomb commentedComment #2
rfayHmm.. 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!
Comment #3
the_g_bomb commentedI 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.
Comment #4
rfayThanks for working on this!
Comment #5
the_g_bomb commentedThink 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.
Comment #6
the_g_bomb commentedFound a typo, sorry. Use this instead
Comment #7
rfayCommitted to 6.x-2.x with a change to the variable name. f25948e
Comment #8
the_g_bomb commentedComment #9
willvincent commentedThis 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.
Comment #10
willvincent commented