I have user profile categories at admin/user/profile specified in a given order - let's say A-B-C-D. At admin/settings/onepageprofile I have the same A-B-C-D order for these categories. These setting will be honoured when *editing* a user profile, however when viewing a profile, the categories appear in a random order (D-C-A-B). They should of course also appear in the same order instead (A-B-C-D).

CommentFileSizeAuthor
#3 onepageprofile-793600.patch895 bytesjantoine

Comments

aidanlis’s picture

Status: Active » Closed (won't fix)

This module is only for the edit page, as the profile page is already on one page.

I do agree with you, it makes sense to have them in the same order, but there's no easy way to do it because there's no correlation between the edit fieldsets and the $account structured arrays. If someone wants to provide a patch, or sponsor the development, I'm happy to implement it. Until then I'll setting this as won't fix.

StormPOP’s picture

roball,
I was wondering the same thing when I can across this issue. I have a solution that isn't perfect, but it's pretty simple and it worked perfectly for me.

Step 1) get the file user-profile.tpl.php from /modules/user

Step 2) in line 45 of the code (at least for my version, if its different it should still be easy to find because there is only a couple lines of real code) delete "print $user_profile;" and replace it with "print_r ($profile);". This will give you all of the array keys.

Step 3) Go to the View tab for your profile. You will see something like this...

Array ( [user_picture] =>
[summary] =>

Member since
October 2010

[simplenews] =>
Newsletters

Current subscriptions
My Newsletter

[User Details] =>

......and so on.

Step 4) Now go back to editing the file user-profile.tpl.php by deleting "print_r ($profile);" and replacing it with "print $profile['REPLACE WITH ARRAY KEY']" for each bracketed array key that you want to include, in the proper order. For example the actual code in my user-profile.tpl.php file looks something like this...

  print $profile['summary']; 
  print $profile['User Details'];  
  print $profile['Projects'];   
  print $profile['Premium Features'];     
  print $profile['simplenews'];   
  

It worked like a charm for me so hopefully others can find this useful.
One obvious shortfall I can imagine is that you would need to edit this if additional profile categories are added in the future.

jantoine’s picture

Version: 6.x-1.9 » 6.x-1.11
Status: Closed (won't fix) » Needs review
StatusFileSize
new895 bytes

This is precisely what hook_profile_alter() is for. Patch attached.

Cheers,

Antoine

roball’s picture

Status: Needs review » Reviewed & tested by the community

Yeah, your patch works perfectly. The solution seems very easy :-)

So can this patch please be committed? Thank you!

dan3h’s picture

This patch worked great for me too. Thanks, @AntoineSolutions!

roball’s picture

Priority: Normal » Major

Please commit. Or is this module already abandoned?

aidanlis’s picture

Not abandoned, but I don't have time to do anything on this module at the moment. Send me an email in a week.

aidanlis’s picture

Status: Reviewed & tested by the community » Fixed

Hooray.

Status: Fixed » Closed (fixed)

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