From d4c5b546f3913f27c3bfd234f91bc8bc02904df8 Mon Sep 17 00:00:00 2001
From: Gareth Alexander <gareth_alexander@hotmail.com>
Date: Sat, 17 Dec 2011 03:46:51 +0000
Subject: porting_patch_for_d7-1022248-8.patch

---
 amazon_store.pages.inc |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/amazon_store.pages.inc b/amazon_store.pages.inc
index e186921..9f8a655 100644
--- a/amazon_store.pages.inc
+++ b/amazon_store.pages.inc
@@ -21,7 +21,7 @@ function _amazon_store_page() {
 
   $output = "";
   $parameters = array();
-
+  $do_search = FALSE;
 
   // Grab the URL args that we'll allow and put them in as parameters for Amazon search
   extract($_GET, EXTR_PREFIX_ALL, "get");
@@ -68,6 +68,7 @@ function _amazon_store_page() {
     $getarg = "get_$entity";
     if (!empty($$getarg) && amazon_store_allowed_parameter($parameters['SearchIndex'], $entity)) {
       $parameters[$entity] = $$getarg;
+      $do_search = TRUE;
     }
   }
 
@@ -94,7 +95,7 @@ function _amazon_store_page() {
     }
   }
 
-  if (!empty($parameters['ItemId'])) {
+  if (!empty($parameters['ItemId']) && $do_search == FALSE) {
     $results = _amazon_store_itemlist(array('ItemId' => $parameters['ItemId']));
   }
   else {
-- 
1.7.6.msysgit.0

