The access handler works fine for profile fields that have profile privacy controls enabled. If they don't, and the fields are admin-set to be public, they still do not show.

Working on a patch..

Comments

mstef’s picture

I think there's a mistake in the logic in _profile_privacy_views_field_access(), towards the bottom:

  if (isset($account->{'private_' . $field->name}) && $field->privacy) {
    $access = profile_privacy_get_field_access($account, $field);
  }
  elseif (PROFILE_PRIVATE == $field->visibility) {
    $access = FALSE;
  }
  else {
    // Field was set as PROFILE_HIDDEN in Profile module config, so check
    // whether it's overridden in the view.
    if (!$handler->options['profile_privacy_show_hidden']) {
      $access = FALSE;
    }
  }

The last ELSE clause, checks to see if the View field settings for showing regardless of the field being private is set. But the second clause sets access to FALSE if it is private. That doesn't make sense. The check for the override should be in the middle clause, and the remaining ELSE should simply be $access = TRUE, because in that case, there are NO profile_privacy settings, and the field is public.

mstef’s picture

Version: 6.x-2.0-beta2 » 6.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new919 bytes

Patch

cpliakas’s picture

Thanks, mikestefff . Sorry for just seeing this now. Will review within the next couple of days.

cpliakas’s picture

Status: Needs review » Reviewed & tested by the community

Tested out the patch and it seems to work fine for me.

cpliakas’s picture

Title: Views access handler is broken » Views access handler is broken for fields that don't have profile privacy controls enabled
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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