Problem with field groups
Matt V. - February 21, 2007 - 17:13
| Project: | CCK Field Permissions |
| Version: | 5.x-1.10 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Description
I created a new field that I only wanted to show for a certain group of users. I installed the module, enabled the module, enabled the cck node type I wanted to control, chose the field I wanted to limit, then enabled all permissions for the particular group I wanted to have editing that particular field. However, when I logged in as a user in one of the other groups, the field still displayed. What am I missing?

#1
I also have this problem with 5.1. CCK perms also give me sql errors.
#2
I too am having problems with the fields showing even though I set up everything correctly. I'm using 5.1.
#3
Oh, I think I found part of the problem. I'm trying to hide the field in a view. If the content type is on it's own then it works fine. Is there a work around?
#4
5.1.5 should fix this issue, please update to this version.
#5
woops, make that 5.1.6
#6
I am not sure if this is fixed or not. I made 2 fields,only 1 is viewable by guest which i set admin/user/access
Then I logout and I could still see 2 fields.
#7
The status shows that its fixed, I redownload the whole pakage and it is still not working for me. So, I set it back to active. I am sorry if it has been fixed.
#8
still does not work using version 5.x-1.8
#9
Confirm.
Fields sill showing. Though, fields are hidden while editing a form.
Module version is 5.x-1.8
#10
Another concurrence. I can block field write permissions, but not read permissions. 5.1, 1.8.
#11
Confirm, the problem is still active.
#12
Pls fix it ^^ :)
#13
Confirmed. Right now the module doesn't do what it's supposed to do.
#14
It's not working for me either.
Question: can I safely rollback to the previous version?
#15
Which version does work?
#16
Ok, This bug is annoying a lot. I had a look at the code but I'm a bit lost.
as far as I understand the problem should be in the function cck_field_perms_nodeapi
but it seems that this function is never called (I just tried to print something at the beginning
of the function). Can anybody give me a quick explanation of how this module is supposed
to restrict visibility of a certain field ?
cheers.
#17
I am using 5.x-1.8 on two of my sites, one is working, but the other has the same problem as discussed here. I am really confused why this happen. Hope this problem will be solved soon.
#18
huayen, which modules do you use on "working" site? And which ones on another?
#19
The problem is in cck_field_perms_nodeapi
foreach ($disallowed_fields[$type] as $disallowed_field) {
should be
foreach ($disallowed_fields[$type] as $disallowed_field => $a) {
or something similar as _cfp_content_to_readable is interested only about the keys and not the values
of the array. I think the same goes for _cfp_form_helper
If this works I'll roll a proper patch.
#20
Tried the " => $a" suggested in comment #19, doesn't work for me. I'm running v1.8 on a pretty new test site with 5.1.
#21
hi,
you have to change the line from
foreach ($disallowed_fields[$type] as $disallowed_field){to
foreach ($disallowed_fields[$type] as $disallowed_field => $value){and add a line
if($value==0){continue;}as the first statement inside the block.
The whole block than looks like this:
foreach ($disallowed_fields[$type] as $disallowed_field => $value) {if($value==0){continue;}
if (!(user_access(_cfp_content_to_readable($type, $disallowed_field, "view")))){
unset($node->$disallowed_field);
unset($node->content[$disallowed_field]);
}
}
#22
Thanks, it works. I've also amended the similar snippet in the _cfp_form_helper function - so the edit forms work as well. Nice.
#23
the patch.
#24
patch applies and works with 5--1-8. Please commit.
Thanks
#25
Patch works for me too, thanks.
#26
Thanks everyone, can we get a new release for all us Noobs who can't apply patches?
#27
I just added the patch to 1.8. I have a CCK field that is a set of radio buttons. Turned off the view field permission (and all other permissions) for anonymous and registered users and then tried to add a node. The field still shows up and can be modified.
#28
Sorry - cancel that last comment. I had just made the edit suggested a couple of posts back and not applied the entire patch. Applied the full patch and all seems to work fine now.
Thanks!
#29
After applying the patch, I am still having the same issue.
All related modules are the most recent versions... I cant find any other reason for this not to be working!
#30
Same problem here. Manually applied patch and am getting unauthorized view of textfields with phone numbers and the like.
If there's anything an amateur can do to help, please let us know!
#31
After starting with a simple one-field node type, I discovered the following:
Using the patches above, I was able to get the module to work when APPLIED TO FIELDS OUTSIDE A GROUP.
The fields I wanted to hide, I simply moved out of a group and used the weights to get them in the proper order. Not perfect, but it works enough for me.
Still hoping for a total fix!
#32
Maybe related to the fieldgroup stuff - we committed this in latest -dev CCK a few days ago.
I had second thoughts afterwards, but for now it's still in.
+ when you change a title in the issue queue, it changes the title of the whole thread :-)
#33
Patch from munga has been applied, along with some code cleanup. I hope to resolve some of the issues with field groups, however because field groups have changed over time with CCK, my aim is only going to be on the latest CCK versions.
#34
Hi:
I've downloaded, installed an properly configured the last version of the module (5.x.1.10) (not available in the version box yet :-( )
And it seems to do nothing... All roles (included anonymous) can see the restricted fields and roles with edit permissions can see and edit fields.
I have all checkboxes in the module section of admin/user/access disabled, so in theory, only superadmin could see the fields...
This version seems to have the patch from munga applied but it doesn't seem to work for me.
Anybody else?
Many thanks.-
#35
Hi neurojavi-
Can you send me a screen shot of your admin/user/access screen for cck_field_perms? I ask because I'm using it without the experience that you're describing here.
thanks
#36
Hi:
Here is the screenshot
Thanks.-
#37
I had to confirm the problem too.
The new Version 5.x-1.10 doesn't work for me too. I will use the 5.x-1.8 with the patch, till the problem is solved.
#38
What version of CCK are you using? I've been testing against 1-4, but I haven't tested against 1-5 yet which maybe the source of the issue?
#39
also, can you let me know if you have the field group module on?
#40
Hi arthurf:
I'm using cck-5.x-1.5 and the field group module is DISABLED.
Hope this helps...
Javi.-
#41
Can you try turning on the field group module? I think that I have to require the field group module to make things work.
#42
Hi:
I've enabled the field group module and doesn't appear to be any change.
I'm still seeing the fields with a user without any permissions to see those fields.
Thanks.-
#43
just changing state...
#44
With the latest version(5.x-1.10), the access control for each individual field seems fine. However, it doesn't work when I tried to hide a complete group without checking each individual field. Not the way it's supposed to work, with the text "Checking this box will hide this complete field group" under the checkbox for the group.
This is definitely a very useful and powerful module. But the defect is not minor.
Any plan to fix this bug?
#45
well I played around w/ group issue. It seems that the problem is that if at least one filed from a particular group is hidden the whole group will not be displayed. Check the 404 line in /modules/cck/fieldgroup.module. For now I've commented this part from 404 to 407...
Hope this will guide you to proper patch ;)
#46
Did anyone resolve this issue yet?
Thanks.