We are building a site that uses Mobile Tools (http://drupal.org/project/mobile_tools), one feature it has is to assign "Mobile versions" of Roles (including an Anonymous Mobile role) when the user is on the mobile site (detected via m.* domain name).
This seems to cause a problem with Webform, all our Webform pages display the page content fine (ie, not getting a 404 or Unauthorized message or anything, the node access seems fine), but there is no actual form present, and "You must login to view this form." is displayed in the messages area.
We're probably just going to disable Mobile Tools' Roles feature, since we're not really using it for anything right now, but I thought I should report this.
I'm filing this under Webform issues (as opposed to Mobile Tools) since the node seems to come up OK... and if the node comes up OK, shouldn't the webform display too?
Comments
Comment #1
quicksketchYou probably are only allowing authenticated users to view the form (hence the message). When the user is switched to the m.* domain, they probably don't have their session cookie any more. You can probably fix this by explicitly setting your $cookie_domain in settings.php to your domain. If your site lived at "www.example.com" and "m.example.com", the cookie name would need to be ".example.com" (with the leading period). Then your user sessions would persist across subdomains.
Comment #2
brian_c commentedNope, these are public "Contact Us" and "Sign up for our Newsletter" forms that should be fully available to everyone, anonymous or authenticated.
Also, the webform node IS loading and displaying fields (ie, body) properly, so the user does have permission to view the node... and doesn't having permission to view the node mean they should have permission to see the form?
I'll see if I can replicate this with a minimal install.
Comment #3
quicksketchWebform provides permissions under the Webform -> Form Settings tab on the node to only allow certain roles to access the form. I don't know how/why that would be affecting the mobile site but not the normal one.
Comment #4
brian_c commentedAh! That explains it.
I did a quick search when first experiencing the problem (after checking the main permissions page), and came across this thread: http://drupal.org/node/226987#comment-747474, where you state "Webform doesn't have any access control code to prevent users from viewing webforms.", but I see now this is hideously out of date; that's a 5.x thread.
Tested this with a fresh install, and everything works as expected with Webform roles' settings and Mobile Tools Roles. Sorry for the false alarm!