? .cvsignore
? drbm.tmproj
? mail.patch
? markup_callback.patch
? nbproject
? profile.patch
? profile_render.patch
? tmp.patch
? tmp.patch.patch
? value_callback.patch
? modules/node/node-admin-display-overview-form.tpl.php
? modules/node/node.build_mode.inc
? sites/all/modules
? sites/default/files
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.960
diff -u -F^f -p -r1.960 user.module
--- modules/user/user.module	22 Jan 2009 12:46:07 -0000	1.960
+++ modules/user/user.module	3 Feb 2009 17:00:12 -0000
@@ -40,7 +40,7 @@ function user_theme() {
       'template' => 'user-picture',
     ),
     'user_profile' => array(
-      'arguments' => array('account' => NULL),
+      'arguments' => array('elements' => NULL),
       'template' => 'user-profile',
       'file' => 'user.pages.inc',
     ),
Index: modules/user/user.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v
retrieving revision 1.27
diff -u -F^f -p -r1.27 user.pages.inc
--- modules/user/user.pages.inc	22 Jan 2009 04:43:32 -0000	1.27
+++ modules/user/user.pages.inc	3 Feb 2009 17:00:12 -0000
@@ -145,15 +145,22 @@ function user_logout() {
 
 /**
  * Menu callback; Displays a user or user profile page.
+ * 
+ * To theme user profiles, copy modules/user/user_profile.tpl.php
+ * to your theme directory, and edit it as instructed in that file's comments.
  */
 function user_view($account) {
   drupal_set_title($account->name);
   // Retrieve all profile fields and attach to $account->content.
   user_build_content($account);
+  
+  $build = $account->content;
+  $build += array(
+    '#theme' => 'user_profile',
+    '#account' => $account,
+  );
 
-  // To theme user profiles, copy modules/user/user_profile.tpl.php
-  // to your theme directory, and edit it as instructed in that file's comments.
-  return theme('user_profile', $account);
+  return drupal_get_page($build);
 }
 
 /**
@@ -166,11 +173,10 @@ function user_view($account) {
  */
 function template_preprocess_user_profile(&$variables) {
   $variables['profile'] = array();
-  // Sort sections by weight
-  uasort($variables['account']->content, 'element_sort');
+
   // Provide keyed variables so themers can print each section independently.
-  foreach (element_children($variables['account']->content) as $key) {
-    $variables['profile'][$key] = drupal_render($variables['account']->content[$key]);
+  foreach (element_children($variables['elements']) as $key) {
+    $variables['profile'][$key] = drupal_render($variables['elements'][$key]);
   }
   // Collect all profiles to make it easier to print all items at once.
   $variables['user_profile'] = implode($variables['profile']);
