Index: uc_profile.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_profile/uc_profile.module,v
retrieving revision 1.4
diff -u -p -r1.4 uc_profile.module
--- uc_profile.module	25 Nov 2009 01:13:31 -0000	1.4
+++ uc_profile.module	2 Jul 2010 06:13:35 -0000
@@ -48,6 +48,9 @@ function uc_checkout_pane_profile($op, &
       $profile_form = profile_form_profile($edit, $user, 'ubercart');
       //$extra = _user_forms($null, $user, 'ubercart', 'register');
       if (!empty($profile_form)) {
+        // Map existing order values on profile form, e.g. for back link on checkout page.
+        _uc_profile_profile_form_value_map($profile_form, $arg1);
+
         $contents =  $profile_form['ubercart'];
         $contents['#title'] = t(variable_get('uc_profile_title', 'Profile'));
       }
@@ -119,4 +122,26 @@ function uc_profile_menu_alter(&$items) 
 function uc_profile_uc_checkout_complete($order, $account) {
   $edit = $order->data['profile'];
   profile_save_profile($edit, $account, 'ubercart');
+}
+
+
+/**
+ * Helper function to populate default values of profile form with current
+ * (temporary) order values.
+ *
+ * @param $profile_form
+ *  Form API array retrieved from profile_form_profile(), passed by reference.
+ * @param $order
+ *  Order object as it is provided in hook_order('view',...);
+ * @return
+ *  nor return value, $profile_form is passed by reference and so will be
+ *  altered during function call.
+ */
+function _uc_profile_profile_form_value_map(&$profile_form, $order) {
+  // Values have to be present, else use profile's default values.
+  if (isset($order->data['profile']) && !empty($order->data['profile'])) {
+    foreach ($order->data['profile'] as $key => $value) {
+      $profile_form['ubercart'][$key]['#default_value'] = $value;
+    }
+  }
 }
\ No newline at end of file
