No padlock for custom content types associated to a profile using nodeprofile.

gauravkumar87 - August 23, 2008 - 07:57
Project:CCK Field Privacy
Version:5.x-1.2
Component:User interface
Category:bug report
Priority:normal
Assigned:obsidiandesign
Status:postponed (maintainer needs more info)
Description

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?

#1

obsidiandesign - August 24, 2008 - 05:14
Assigned to:Anonymous» 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.

#2

gauravkumar87 - August 25, 2008 - 05:53

hi,

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

#3

gauravkumar87 - August 25, 2008 - 09:43

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?

#4

gauravkumar87 - September 2, 2008 - 12:57
Status:postponed (maintainer needs more info)» active

#5

BDuell - September 12, 2008 - 01:37

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.

#6

gauravkumar87 - September 15, 2008 - 06:11

hi bduell,

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

#7

gauravkumar87 - September 15, 2008 - 09:54

never mind...

thanks a lot :) ...

will submit a patch file for this...

#8

gauravkumar87 - September 15, 2008 - 09:48

@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.

#9

obsidiandesign - September 17, 2008 - 03:42

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.

#10

gauravkumar87 - September 17, 2008 - 09:09

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

#11

obsidiandesign - December 24, 2008 - 03:48
Status:active» postponed (maintainer needs more info)

Can anyone confirm that this is still an issue?

Thanks,
Bryan

#12

SocialNicheGuru - December 24, 2008 - 18:01

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?

#13

SocialNicheGuru - January 29, 2009 - 17:19

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

 
 

Drupal is a registered trademark of Dries Buytaert.