I issue this as a support request because i couldn't find anything documented on how this should behave:

I have a user who entered fields in the following profile-categories:

  • Contact
  • General information: Person
  • General information: Study
  • Goals and plans
  • My Competencies
  • My studyproject
  • Professional training and carreer
  • Research
  • Teaching

I have reset all field-weights to zero to be sure that this doesn't affect the results.

The query for the setup of $user->content in profile_view_profile (file: profile.module) works correctly as it returns all profile_fields ordered ascending by category.

Also template_preprocess_user_profile (file: user.pages.inc) gets the $variables['account']->content in the right sort-order even though content_profile and summary have been added at the beginning and user_picture and domain at the end.

The following uasort in template_preprocess_user_profile that invokes element_sort (file: common.inc) on the other hand messes up the sort-order completely... i now get:

  • user_picture
  • My studyproject
  • Professional training and carreer
  • Teaching
  • content_profile
  • Research
  • My Competencies
  • Contact
  • Goals and plans
  • General information: Person
  • General information: Study
  • summary
  • domain

while i appreciate that summary and domain end up at the end of the list, the whole sort-order of my profile-categories is wrong and content_profile (a seperate node element) is placed somewhere in the middle of my profile-fields. Again there is no field in any of those categories with a weight other than zero. The same thing happens in other minor revision of 6.x as well.

I have no clue where to go from here, so any pointer would be appreciated. It seems there is no guarantee for the order of categories (as element_sort orders by weight only) in the user-page... this is particularly awkward because the profile.module orders the category-tabs alphabetically, so users might expect that to be the order on their user-page as well. Also if this issue is going to be a feature request in the future, a bit of discussion would be vital for an implementation.

Comments

mischan’s picture

i forgot to say: even if you add weights to the fields in the alphabetical order of categories which can be quite cumbersome, the category order is still messed up.

NicoDruif’s picture

I wanted to say that I have the same issue here: I am wondering how I can order the categories on a profile page... Anybody?

NicoDruif’s picture

I did manage to sort the profile categories by calling them in a certain order in my user-profile.tpl.php like this:

		<?php print $profile['Echte naam']; ?>
		<?php print $profile['Contact']; ?>
		<?php print $profile['Adres']; ?>
		<?php print $profile['summary']; ?>
		<?php print $profile['vcard']; ?>

www.druifdesign.nl

mischan’s picture

Yes, that would be a possible solution, but I am looking for something where no template or code intervention is necessary (ie it should be done via the administrative interface). Our current solution is to simply build a view where each category gets its own subview. But you still have to link to that view from the profile page and it is not as nicely integrated.

ciancomp’s picture

I was having the same issue as well. I did the checks of the order and discovered I could hardcode the categories but the user image drops. I found a fix on another thread. Be sure to read down because there is an update to the initial fix: http://drupal.org/node/270352#comment-1113360

ainigma32’s picture

Status: Active » Fixed

Solution(s) provided so setting to fixed.

- Arie

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

mikespainhower’s picture

The following module provides a solution:
http://drupal.org/project/profile_category_weight