Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Would it be possible to support Profile 2 fields as well ?
Comment | File | Size | Author |
---|---|---|---|
#1 | user_field_privacy_1398586_profile2_support.patch | 3.03 KB | Simon Georges |
Comments
Comment #1
Simon Georges CreditAttribution: Simon Georges commentedI'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.
Comment #2
BoobaaWell, the project page of Profile 2 says:
Based on that I would patch Profile 2 itself, not user_field_privacy.module. YMMV.
Comment #3
Simon Georges CreditAttribution: Simon Georges commentedIt'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).
Comment #4
Simon Georges CreditAttribution: Simon Georges commentedIt 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...
Comment #5
fraweg CreditAttribution: fraweg commentedHello,
did you solved this problem?
Thanks for your work in this module!
Best regards
Frank
Comment #6
BoobaaOkay, 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.
Comment #7
Simon Georges CreditAttribution: Simon Georges commentedAs 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.
Comment #8
fraweg CreditAttribution: fraweg commentedHello,
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
Comment #9
mikispeed CreditAttribution: mikispeed commentedI 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
Comment #10
warmth CreditAttribution: warmth commentedAny 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.
Comment #11
mikispeed CreditAttribution: mikispeed commented@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.