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.
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?
Comment | File | Size | Author |
---|---|---|---|
#36 | cck_field_perms.png | 120.25 KB | neurojavi |
#23 | cck_field_perms.module.patch.txt | 1.86 KB | munga |
Comments
Comment #1
dzynz CreditAttribution: dzynz commentedI also have this problem with 5.1. CCK perms also give me sql errors.
Comment #2
horizens CreditAttribution: horizens commentedI too am having problems with the fields showing even though I set up everything correctly. I'm using 5.1.
Comment #3
horizens CreditAttribution: horizens commentedOh, 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?
Comment #4
arthurf CreditAttribution: arthurf commented5.1.5 should fix this issue, please update to this version.
Comment #5
arthurf CreditAttribution: arthurf commentedwoops, make that 5.1.6
Comment #6
sanyi CreditAttribution: sanyi commentedI 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.
Comment #7
sanyi CreditAttribution: sanyi commentedThe 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.
Comment #8
sanyi CreditAttribution: sanyi commentedstill does not work using version 5.x-1.8
Comment #9
nbayaman CreditAttribution: nbayaman commentedConfirm.
Fields sill showing. Though, fields are hidden while editing a form.
Module version is 5.x-1.8
Comment #10
bchoc CreditAttribution: bchoc commentedAnother concurrence. I can block field write permissions, but not read permissions. 5.1, 1.8.
Comment #11
Jensor CreditAttribution: Jensor commentedConfirm, the problem is still active.
Comment #12
nbayaman CreditAttribution: nbayaman commentedPls fix it ^^ :)
Comment #13
gaele CreditAttribution: gaele commentedConfirmed. Right now the module doesn't do what it's supposed to do.
Comment #14
oprior CreditAttribution: oprior commentedIt's not working for me either.
Question: can I safely rollback to the previous version?
Comment #15
nbayaman CreditAttribution: nbayaman commentedWhich version does work?
Comment #16
munga CreditAttribution: munga commentedOk, 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.
Comment #17
huayen CreditAttribution: huayen commentedI 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.
Comment #18
nbayaman CreditAttribution: nbayaman commentedhuayen, which modules do you use on "working" site? And which ones on another?
Comment #19
munga CreditAttribution: munga commentedThe 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.
Comment #20
freeman-1 CreditAttribution: freeman-1 commentedTried 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.
Comment #21
1st-angel CreditAttribution: 1st-angel commentedhi,
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:
Comment #22
freeman-1 CreditAttribution: freeman-1 commentedThanks, it works. I've also amended the similar snippet in the _cfp_form_helper function - so the edit forms work as well. Nice.
Comment #23
munga CreditAttribution: munga commentedthe patch.
Comment #24
acpatch applies and works with 5--1-8. Please commit.
Thanks
Comment #25
Jensor CreditAttribution: Jensor commentedPatch works for me too, thanks.
Comment #26
oprior CreditAttribution: oprior commentedThanks everyone, can we get a new release for all us Noobs who can't apply patches?
Comment #27
jarea CreditAttribution: jarea commentedI 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.
Comment #28
jarea CreditAttribution: jarea commentedSorry - 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!
Comment #29
Ryan Palmer CreditAttribution: Ryan Palmer commentedAfter 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!
Comment #30
Cayenne CreditAttribution: Cayenne commentedSame 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!
Comment #31
Cayenne CreditAttribution: Cayenne commentedAfter 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!
Comment #32
yched CreditAttribution: yched commentedMaybe 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 :-)
Comment #33
arthurf CreditAttribution: arthurf commentedPatch 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.
Comment #34
neurojavi CreditAttribution: neurojavi commentedHi:
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.-
Comment #35
arthurf CreditAttribution: arthurf commentedHi 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
Comment #36
neurojavi CreditAttribution: neurojavi commentedHi:
Here is the screenshot
Thanks.-
Comment #37
Jensor CreditAttribution: Jensor commentedI 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.
Comment #38
arthurf CreditAttribution: arthurf commentedWhat 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?
Comment #39
arthurf CreditAttribution: arthurf commentedalso, can you let me know if you have the field group module on?
Comment #40
neurojavi CreditAttribution: neurojavi commentedHi arthurf:
I'm using cck-5.x-1.5 and the field group module is DISABLED.
Hope this helps...
Javi.-
Comment #41
arthurf CreditAttribution: arthurf commentedCan you try turning on the field group module? I think that I have to require the field group module to make things work.
Comment #42
neurojavi CreditAttribution: neurojavi commentedHi:
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.-
Comment #43
neurojavi CreditAttribution: neurojavi commentedjust changing state...
Comment #44
walterhoct CreditAttribution: walterhoct commentedWith 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?
Comment #45
mornel CreditAttribution: mornel commentedwell 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 ;)
Comment #46
samlogan CreditAttribution: samlogan commentedDid anyone resolve this issue yet?
Thanks.
Comment #47
interestingaftermath CreditAttribution: interestingaftermath commentedThis is SUCH a major defect. It makes the module unusable for most cases. I am unable to check all 6 fields because I get a PHP memory error (my php memory limit is 96). That's no good.
Not sure what I am going to do...