--- uc_attribute_stock_filter.module~	2009-04-05 20:32:03.000000000 -0400
+++ uc_attribute_stock_filter.module	2010-01-04 01:41:31.000000000 -0500
@@ -85,7 +85,7 @@
       }
     }
     else if ($product_attributes->count > 0) { // The product has at least one attribute
-      $result = db_query("SELECT a.combination AS combination, s.stock AS stock FROM {uc_product_adjustments} a, {uc_product_stock} s WHERE a.nid = %d AND s.sku = a.model AND s.active = 1", arg(1));
+      $result = db_query("SELECT a.combination AS combination, s.stock AS stock FROM {uc_product_adjustments} a, {uc_product_stock} s WHERE a.nid = %d AND s.sku = a.model AND s.active = 1", $form['nid']['#value']);
 
       // This builds an array containing the available options
       $available = array();
@@ -110,4 +110,4 @@
     }
 
   }
-}
\ No newline at end of file
+}
