no option for hiding field

igorik - August 7, 2007 - 22:57
Project:nodeprofile privacy
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

hi!

I enabled this module, then went to content type field settings, I enabled "let user hide this field" for some fields, but there is no change after submit.
I can't see any option or button for hiding selected field...
maybe I am doing something wrong, but no more is in readme.txt

thanks
Igor
somvprahe.sk

#1

ben.scott - August 8, 2007 - 11:17

Hi Igor -

The process for defining a field to be show/hidden is as follows (sorry if the readme.txt wasn't clear - once this is sorted out I'll change it)...

As an administrator, select edit a content type, and for whatever fields you want to hide, select 'Allow users to show/hide this field'.

When you create / edit a node of that content type, there should now be a tick box beneath the chosen fields called 'Make this field private'.

Let me know if this doesn't work for you, and I'll investigate further.

Cheers, Ben

#2

igorik - August 8, 2007 - 11:42

Hi, I supposed exactly something like this, but I haven't there that checkbox for hiding it. (I did then everything you wrote, enabled moduel, and set in field options let user to hide this field.)
anyway, I will try it again, I am using Jquery update and drupal 5.2

bye for now
Igor

#3

ben.scott - August 22, 2007 - 12:50

Hi Igor

Sorry about the bug - this should now be fixed in the latest release.

Chees, b3n

#4

ebeyrent - November 1, 2007 - 14:48

I downloaded the version of this module from the drupal project page (http://drupal.org/project/nodeprofile_privacy), and when a regular non-admin user edits his or her profile, there is no checkbox under the fields I configured as admin for the user to choose whether or not to display the field.

Is there another version of the code somewhere that has this functionality?

#5

ben.scott - November 18, 2007 - 12:48

Hi ebeyrent -

Could you have a go with the latest version please. I've changed the way the check boxes are added to the form, which I think should help with your bug (although I haven't been able to recreate it so far). let me know how you get on...

Cheers, b3n

#6

ben.scott - November 18, 2007 - 12:48

Hi ebeyrent -

Could you have a go with the latest version please. I've changed the way the check boxes are added to the form, which I think should help with your bug (although I haven't been able to recreate it so far). let me know how you get on...

Cheers, b3n

#7

ebeyrent - November 19, 2007 - 15:55

It looks like the problem lies in the form object. If I dump the form object that gets passed to the nodeprofile_privacy_form_alter() function, the field name is at a deeper level than the code is checking for.

Line 131

<?php
if (!$form[$field_name]) {
  continue;
}
?>

However, $field_name exists under $form['#node']. I think what we need instead is:

<?php
if(! $form['#node']->$field_name) {
  continue;
}
?>

This seems to work for me.

#8

ebeyrent - November 19, 2007 - 16:20
Category:bug report» feature request
Priority:critical» normal

It would be nice to give the user the option to make fields marked as private visible to those in their buddylist. So, if I view a user profile with private fields, and I am not a buddy of this person, I don't get to see the private fields. However, if I am on the user's buddylist and that user has chosen to show private fields to buddies, I would get to see the fields.

What do you think?

 
 

Drupal is a registered trademark of Dries Buytaert.