diff -Naur /Users/acs/aws_deps/import_aws/aws.info ./aws.info --- /Users/acs/aws_deps/import_aws/aws.info 2008-08-23 05:06:42.000000000 -0700 +++ ./aws.info 2008-10-11 11:21:13.000000000 -0700 @@ -1,5 +1,6 @@ name=AWS Import description=Amazon Web Services Product Import Module +dependencies = jquery_update ; Information added by drupal.org packaging script on 2008-08-23 version = "5.x-0.x-dev" diff -Naur /Users/acs/aws_deps/import_aws/aws.install ./aws.install --- /Users/acs/aws_deps/import_aws/aws.install 2008-08-22 17:31:06.000000000 -0700 +++ ./aws.install 2008-10-11 11:21:13.000000000 -0700 @@ -40,10 +40,15 @@ )"); require_once('aws.module'); + variable_set('aws_master_index_url', 'http://www.workhabit.com/sites/default/files/aws/master/aws_search_params.xml'); _aws_build_search_indices(); - + return $queries; } +function aws_update_1() { + _aws_build_search_indices(); + variable_set('aws_master_index_url', 'http://www.workhabit.com/sites/default/files/aws/master/aws_search_params.xml'); +} ?> diff -Naur /Users/acs/aws_deps/import_aws/aws.module ./aws.module --- /Users/acs/aws_deps/import_aws/aws.module 2008-08-21 18:29:07.000000000 -0700 +++ ./aws.module 2008-10-11 13:50:03.000000000 -0700 @@ -11,8 +11,7 @@ function aws_menu($may_cache) { $may_cache = TRUE; // debug if ($may_cache) { - $items = array(); - + $items = array(); //Settings-related $items[] = array('path' => 'admin/settings/aws/auth', 'title' => t('Authentication Settings'), @@ -213,7 +212,7 @@ //implode search parameters and values foreach($_POST as $k => $v) { - $kw[] = $k . "=" . $v; + $kw[] = $k . "=" . urlencode($v); } $keywords = implode("&", $kw); @@ -233,8 +232,11 @@ $all_items = $xml_result->xpath("Items/Item"); if($all_items) { $i = 0; + $result[$i] = array(); + $result[$i]['import'] = array(); foreach($all_items as $item) { - $asin = (int)$item->$i->ASIN; + $item_stat = @$item->$i; + $asin = (int)$item_stat->ASIN; $result[$i]['import']['data'] = _aws_generate_import_widget($asin); $result[$i]['import']['class'] = "import_widget"; foreach($things as $field => $xpath) { @@ -248,7 +250,8 @@ $result[$i][$field]['class'] = "marker_" . $field; } } - $result[$i]['asin']['data'] = $item->$i->ASIN; + $result[$i]['asin'] = array(); + $result[$i]['asin']['data'] = $asin; $result[$i]['asin']['class'] = "marker_asin"; $i++; } @@ -599,33 +602,29 @@ return 'admin/settings/aws/import'; } - function _aws_add_hidden(&$form, &$form_values, $key) { $form[$key] = array('#type' => 'hidden', '#value' => $form_values[$key]); } - - function aws_search_index_import() { return _aws_build_search_indices(TRUE); } - function _aws_build_search_indices($show_messages = FALSE) { $master_index = variable_get('aws_master_index_url', ''); if (!$master_index) { - $master_index = 'http://www.workhabit.org/files/aws/master/aws_search_params.xml'; - variable_set('aws_master_index_url', $master_index); + $master_index = 'http://www.workhabit.com/sites/default/files/aws/master/aws_search_params.xml'; } $msg = 'Fetching search param feed from ' . $master_index; if ($show_messages) { drupal_set_message($msg); } watchdog('info', $msg); - - $response = drupal_http_request($master_index); + + $response = drupal_http_request($master_index); $sxmldoc = simplexml_load_string($response->data); + $results = array(); foreach ($sxmldoc->index as $index) { _aws_process_index($index, $results);