Hi,

I have three custom content types that are associated with a user profile using node profile. I tried to apply privacy to the fields of these content types using cck_field_privacy. However i fail to get padlocks besides the fields.
I also have other custom content types and cck privacy seems to be working fine with them. The problem is only with cck types associated to a user profile. Could there be any conflicts? How do i fix this?

Comments

obsidiandesign’s picture

Assigned: Unassigned » obsidiandesign
Status: Active » Postponed (maintainer needs more info)

By chance, are you using pageroute? I'm noticing a similar issue here on my dev box (custom content types OK, node profile content types not working), and am trying to figure out if pageroute is causing the issue.

gauravkumar87’s picture

hi,

no i'm not using pageroute...
jus nodeprofile for profiles....

gauravkumar87’s picture

i looked in to this and it might have something to do with node profile changing the form id of the forms of the cck types when select them to be shown as a category on the edit form. The form id of all these forms become 'user-edit' whereas cck_privacy was expecting something lik example-edit (where example is the cck type) in the form_alter hook... any thoughts?

gauravkumar87’s picture

Status: Postponed (maintainer needs more info) » Active
bduell’s picture

I added the following:
$node_name_array[0] = $form['type']['#value'];

after the line that reads:
$node_name_array = explode('_', $form_id);

And that fixed this issue with the user profiles for me.

gauravkumar87’s picture

hi bduell,

please provide further details.. where did u add this?

gauravkumar87’s picture

never mind...

thanks a lot :) ...

will submit a patch file for this...

gauravkumar87’s picture

@obsidiandesign,

your module breaks in the hook_form_alter implementation.

//Figure out what node type (via name) we are accessing.
$node_name_array = explode('_', $form_id);

Supposing the name of the content type is foo_bar , in that case $node_name_array is populated with
[0] => foo
[1] => bar
[2] => node
[3] => form

cck_field_privacy expects the name of the content type to be present in $node_name_array[0] which is not the case in the above example.
As, Bduell suggested

$node_name_array = $form['type']['#value'];

overwrites $node_name_array[0] with foo_bar (the node type).
And this serves as a temporary fix.
Will try and fix this and submit a patch.

obsidiandesign’s picture

At least with nodeprofile, part of the issue is the fact that things are not consistent - sometimes it's nodeprofile, others come up node_profile, which are confusing the script as well. Using pageroute, there doesn't seem to be a $form['type'] array, so there's still some cases to investigate/fix, although this is a helpful interim step.

gauravkumar87’s picture

will look into pageroute and cck field privacy.. lets see what turns up...

obsidiandesign’s picture

Status: Active » Postponed (maintainer needs more info)

Can anyone confirm that this is still an issue?

Thanks,
Bryan

socialnicheguru’s picture

i am trying to use this module myself on nodeprofiles.

I do not see the padlocks.

I am also using content template to create a custom theme. is there something else I need to do?
is the privacy element around the field or the content[field] combination?

Thanks,
C

EDIT: I just took a look on Garland and I did not see the padlocks or any other way to signify privacy.
1. installed the module
2. went to content-> content field privacy and specified the private fields
is there anything else?

socialnicheguru’s picture

This is still an issue. Padlocks do not show up on individual cck fields.

I also get two padlocks for the fieldset

If the fieldset is collapsable, the padlocks for the fieldset do not pop up a privacy screen. Instead they just open or close the fieldset

saritha.peddapuli’s picture

Hi,

How can we use cck field privacy module for node profile fields.

Thanks in advance.