I deeply apologize if this issue is misplaced or not actually an issue but a simple lack of understanding on my part. I have a site where I've added lots of fields to my user profiles. I'm using page manager coupled with panels to alter the display of those user profiles. Essentially its a two column layout. I simply want to do a simple "display current user" in the left column and display some related information in the right.

For myself (user/1) this is working perfectly but for anonymous users they can't view any user profiles. If I turn the page manager (user profile template) off anonymous users can see profiles but if I turn it back on they disappear. I've set the "view user profiles" checkbox for anonymous users under permissions but no luck.

Have I missed some additional setting in page manager / panels that overrides the "view user profiles" checkbox or is this a bug? Please help - I'm quickly running out of time to complete this project and visible user profiles are an absolute necessity.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JayDarnell’s picture

More information

After further investigation a friend helped me look at the ctools/plugins/content_types/user_context/user_profile.inc file. We found the source of this "bug" if you can call it a bug. Perhaps it is intended behavior.

Line: 24
if (!$account || ($account->access == 0 && !user_access('administer users'))) {
return NULL;
}

Basically this means that if a user has never logged in their profiles won't display to anonymous users even if the "view user profiles setting" is enabled. This seems to be unintentional given user accounts where the user hasn't logged in respect the "view user profiles" setting.

merlinofchaos’s picture

I think this is how Drupal used to work -- that accounts that had never been logged into didn't truly exist until that had happened. Perhaps Drupal 7 has changed. It would be good to find the matching code in the default user page view and see what it uses (and particularly compare it to Drupal 6). My best guess is that this was a very subtle change in Drupal from D6 to D7 that Page Manager didn't quite catch up on.

merlinofchaos’s picture

Yes, I confirmed -- checking user_view_access() in D6 vs D7 shows that D6 had a user logged in check that D7 no longer has. We'll have to update this to match.

merlinofchaos’s picture

Status: Active » Needs review
FileSize
593 bytes

I think we can just remove that check entirely, there's nothing to replace it with.

JayDarnell’s picture

Thank you so very much merlinofchaos for your super speedy response and for the patch! I'll test it out asap.

jhedstrom’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #4 works as advertised. Thanks!

JayDarnell’s picture

I can also verify that the patch in #4 works as advertised. Thanks again!

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed.

JayDarnell’s picture

Awesome work!

Status: Fixed » Closed (fixed)

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