When I enter a valid Amazon product ID in a node's amazon field, I'm told:

Amazon ID : No Amazon product with the ID 1842779079 could be located.

However, I can search for the same product ID using the test feature of the module (path admin/settings/amazon/test). That works fine.

I don't understand the workings of the module, but the validate operation of the asin_field will always fail.

      $results = _asin_load_items($items);
      foreach ($items as $delta => $item) {
        if (is_array($item)) {
          if (!empty($item['asin']) && empty($results[$item['asin']])) {
            form_set_error($field['field_name'] .']['. $delta .'][asin', t('%name : No Amazon product with the ID %id could be located.', array('%name' => t($field['widget']['label']), '%id' => $item['asin'])));
          }
        }
      }
      return $items;

The _asin_load_items function returns an array that is not indexed by ASIN, so empty($results[$item['asin']]) is always true.

Comments

Anonymous’s picture