Closed (fixed)
Project:
Webform
Version:
5.x-1.10
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2008 at 15:11 UTC
Updated:
15 Apr 2010 at 06:50 UTC
Anonymous users get an "Access denied" page when navigating to a simple webform-created form. I've disabled all other mmodules and still have the issue. I have checked access rights and only with "administer node" can they see and fill in the form. This happens on 2 different sites.
What am I missing here? I can't believe this hasn't been mentioned before ...
tyia
Comments
Comment #1
jacineHi Tyia,
The webform module has its own permissions on the user access page. You do not want to give users the "administer nodes" permission because that also gives the permission to delete and edit nodes all nodes. Scroll down to the bottom of the user acesss page, and you will see the permissions for the webform module. All you need is "create webforms" permission for users to fill out the form.
Comment #2
thedawn commentedHi Jacine,
Thank you for the response. I've tried these settings - they are all enabled for anonymous users. When I said
I meant to say that "administer nodes" is the only permission I've found which allows the form to be seen - no other permissions I've tried (including the Webform section) allow access to the form. Of course you're right, I don't want anonymous users to be able to edit/delete nodes.
As I mentioned I've also disabled all other modules, so it can't be an access conflict with another module.
Comment #3
thedawn commentedReopening ...
Comment #4
quicksketchWebform doesn't have any access control code to prevent users from viewing webforms. It's likely caused by an access control module like organic groups, taxonomy_access, or something similar.
Comment #5
thedawn commentedAs I said I have disabled ALL modules and webform is the only one installed. I have never used organic groups, taxonomy_access etc.
This issue is all that's preventing me from releasing this site to the client. I have tried different versions of webform (running update,) moving the module, disabling, uninstalling, reinstalling and am pulling my hair out more than ever ...
Is there a mySQL table I can check or reset? Any other ideas where this might possibly be set? Anywhere I can look?
I am running Drupal 5.1.
Many thanks in advance
Comment #6
quicksketchIf you've ever installed any node access module, it make a change to the node_access table that will continue to plague you even if you've disabled (but not uninstalled) the module that changed it.
Check your node_access table, it should only have one row in it such as this:
If it doesn't contain this row (or contains other rows), then some node access module has mucked with your site. If you've never installed any modules for node access, then I'm not sure where the problem could be. However, I feel pretty confident that if you installed webform on a clean Drupal install, the problem wouldn't exist.
Comment #7
thedawn commentednode_access table is as above. It is not a clean Drupal install as the site has been in development for several months. However I don't tbelieve this should mean it is necessarily impossible to track down the origin of the problem.
I will start with a new install and add modules one by one ...
Comment #8
thedawn commentedAfter many hours of searching ...
The status field for the webforms in the node table were set to '0'
Changing this to '1' allows anonymous use of the forms.
Why this was so I have no idea - perhaps if I get a chance I will investigate further later.
I will leave this issue active in case someone else has an explanation.
Comment #9
quicksketchThanks for the followup, what a strange thing to have occurring. I'll keep this in mind for others that have a similar problem. Thanks!
Comment #10
thedawn commentedActually, changing status to '1' also gives anonymous users Edit access to the form, so unfortunately this is not a solution.
I'll keep looking ...
EDIT: Correction - I still had User Access Permissions set to allow anonymous editing ...
So, the fix IS as mentioned in post #8 above:
In the node table, sort by node_type (Descending)
For any webform type, check that the status field is '1'
Comment #11
quicksketchGreat :)
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13
jef.koslowski commentedHi,
I was having the same issue here. Used the fix mentioned in post #8 and now its working (thanks for the tip).
Using Webform version 5.x-2.0 and Drupal 5.7.
Comment #14
jef.koslowski commentedOk, I found the problem. When u create a webform, in the "publishing options", the field "published" doesnt come checked by default.
I dont know if this is a bug or not (im pretty new with Drupal).
Comment #15
quicksketchI don't know why I didn't think of this initially, jef.koslowski is correct. Webform (intentionally) unpublishes all new webforms, because you have to add components to the node before it does any good. For this reason, new forms are *always* unpublished, until the "Publish" button is hit on the components form, or the Published checkbox is ticked on the normal node form.
Comment #16
spatialguru commented#8 does not solve it for me - my node is published just fine. I am also unable to allow anonymous users to fill in a webform. Which options in access control are needed?
Comment #17
quicksketchspatialguru, if the node being published is not the problem, could you please open a new issue? The problem on this particular issue seems to be caused by the published flag. We'll need a more descriptive explanation of what you're experiencing.
Comment #18
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #19
webengr commentedLOL
also on drupal 6,
duh
"When u create a webform, in the "publishing options", the field "published" doesnt come checked by default."
I only needed to set published for problem, I am glad this post was here to be googled, save me some foolish time.
Comment #20
gregstout commentedThis just saved me so much time. Thanks!
Comment #21
webengr commentedLMAO
I made this mistake the last time I setup a website several months ago,
found this page and remembered "publishing options" after debugging... :)
senior moments are increasing!
Comment #22
OK Computer commentedAha! This had me stumped for ages. Ticked the published box and it sorted it. Thanks very much!
Comment #23
xayberoptix commentedThank you for clarifying this! It works!
Comment #24
uegonzalez commentedI was having the same issue for custom webforms with multiple roles. When I created the webform, there is an option to specify which roles can "Submit" to the form, but there are never any options to specify who can "See" the forms. I believe the webforms try to use the node_access table, but there is no way to modify that table unless you are using a third party module like "Content Access".
The solution I came up with is to add a new "Access Control" permission called "view webforms" and gave those permissions to a specific role by going to the Access Control section in administration. You need to modify webform.module a little bit to get this to work. Namely webform_perm():
What I changed was:
to:
All I added was 'view webforms' to the front so that you can use the GUI to select the appropriate permission. Now, you have to do something with that permission by going to webform_access():
I changed:
to:
Here, I added the "view" case when accessing a webform. When you give the specific role the "view webforms" permission, then they will be able to access those custom webforms. Hope this helps.
Comment #25
thenarwhalkid commentedThis totally fixed my problem with webform access! Thank you!
Comment #26
noderunner commentedGood news. I need the fix too.
Do I need to uninstall the module and then re-install once I add the code above?
Or do I just use update.php?
Will that fix work for 6.15?
Comment #27
noderunner commentedThe above code is for 5.0 only right?
I tried it on 6.15, and the view was not created. I added the $account parameter without luck also.
A bit out of my depth here.
Must forge ahead, though.
Comment #28
illSleepWheniDie commentedWhen I saw #8
I immediately checked "published" status .. and it worked .. duh! lol ..
Changing the title to help people a little bit more ..
Comment #29
Joar commentedhttp://drupal.org/node/226987#comment-747714
This did it for me, thank you!
Comment #30
enkara commentedThe same here, it was unpublished. I think it's not a good idea to unpusblish it by default, because the normal thing is to have it published. I think people is smart enough to keep the form url in secret until they are done making the changes.