--- sites/all/modules/uc_wishlist/uc_wishlist.pages.inc	2010-06-07 10:29:22.000000000 -0700
+++ sites/all/modules/uc_wishlist/uc_wishlist.pages.inc-new	2010-06-07 10:28:29.000000000 -0700
@@ -1,5 +1,5 @@
 <?php
-// $Id: uc_wishlist.pages.inc,v 1.1 2009/03/27 16:08:33 rszrama Exp $
+// $Id: uc_wishlist.pages.inc,v 1.1.2.2 2010/02/22 15:46:04 longwave Exp $
 
 /**
  * @file
@@ -226,7 +226,6 @@ function uc_wishlist_settings_form_submi
  * Display a page allowing the customer to view his/her wish list.
  */
 function uc_wishlist_view_form($form_state, $items, $wid, $own) {
-  global $user;
   $form = array();
 
   $form['items'] = array(
@@ -262,7 +261,7 @@ function uc_wishlist_view_form($form_sta
     if ($description) {
       $element['description'] = array('#value' => $description);
     }
-    
+
     $context = array( //addition
         'revision'  => 'altered',
         'type'  => 'order_product',
@@ -283,6 +282,10 @@ function uc_wishlist_view_form($form_sta
       '#maxlength' => 6,
       '#disabled' => $own ? FALSE : TRUE
     );
+    if (!$own) {
+      // Disabled elements do not pass their default value.
+      $element['wantqty']['#value'] = $item->qty;
+    }
     $element['haveqty'] = array(
       '#type' => 'textfield',
       '#default_value' => $item->haveqty,
@@ -404,9 +407,12 @@ function uc_wishlist_view_form_submit($f
 
     if ($wpid) {
       foreach ($form_state['values']['items'] as $key => $item) {
-        if ($item['wpid'] == $wpid && $item['qty'] == 0) {
-          $form_state['values']['items'][$key]['qty'] = 1;
-        } elseif($item['wpid'] != $wpid) {
+        if ($item['wpid'] == $wpid) {
+          if ($item['qty'] == 0) {
+            $form_state['values']['items'][$key]['qty'] = 1;
+          }
+        }
+        else {
           $form_state['values']['items'][$key]['qty'] = 0;
         }
       }
