Hi,

Would it be possible to support Profile 2 fields as well ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Simon Georges’s picture

Status: Active » Needs work
FileSize
3.03 KB

I've started the work.
You may select what field to make private.
What doesn't work is actually saving the status of the field (I'm still investigating about that). I'm not entirely sure about selecting the bundle using $field['bundles'][$entity_type][0] either.

Anyway, if I succeed in making it work, I'll post it here.

Boobaa’s picture

Well, the project page of Profile 2 says:

Profile2 supports private profile fields, which are only shown to the user owning the profile and to administrators.

Based on that I would patch Profile 2 itself, not user_field_privacy.module. YMMV.

Simon Georges’s picture

It's a possibility. As it was already working for User Field Privacy, I thought most of the code would stay the same, and figured there was less code to duplicate / to write. But it seems it's a common need (see #1173450: Per user customisation of public/private fields).

Simon Georges’s picture

It seems the custom submit callback is not at the form level, but in a deeper layer of the form (on profile2 entities), so it is not called (and therefore nothing is saved). Definitely needs work...

fraweg’s picture

Hello,

did you solved this problem?

Thanks for your work in this module!

Best regards
Frank

Boobaa’s picture

Project: User Field Privacy » Profile 2

Okay, I won't be able to look into this until somebody provides a _minimal_ step-by-step guide, as I have no intention to use Profile2. In the meantime, reassigning this to the Profile2 queue for the same reasons.

Simon Georges’s picture

As a side note, we didn't need Profile2 any more on the project I was working on, so I didn't finish the work, sorry... Hope it still can be useful to somebody.

fraweg’s picture

Hello,

I hope this work will go on. This would really be an nice feature in Profile2. Unfortunately I have no idea to do this. I am new in PHP and Drupal. So I can not help in this project. I hope someone from the Profile2 project can help a little bit.

Best regards,
Frank

mikispeed’s picture

I have already done some work and module can be viewed here: http://drupal.org/sandbox/miki/1601986
I have tried using User Field Privacy module with Profile2 but then realized it is not intended to function with it. So I ended up with my own module that does the same thing but with Profile2 support.

Miki

warmth’s picture

Any news? I want the user to select if they wanna show for example the birthday to their friends only (User Relationship module), the phone to no one and the address to only registered users, the website to everyone, etc.

mikispeed’s picture

@warmth I'm afraid this module will not give you those options out of the box. You will have to develop them or take a look at some other modules.