Hi,
hidden components seem not to be included in email notifications. They're stored in db correctly.
I searched in the code but couldn't find any suspect bug. Any hints on where to look?

Thanks

CommentFileSizeAuthor
#10 webform_hidden_email.patch1.1 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ermannob’s picture

Title: missing hidden components in emails » missing hidden components in emails when anonymous users submit

Sorry, I missed an important information: this problem exists only when anonymous users submit my webform.

ermannob’s picture

I found a solution: I have to let anonymous users "access all webform results".
Well... is that a proper solution? :-)

Thanks.

quicksketch’s picture

Category: bug » support

This is the normal functionality of Webform. Hidden fields are only shown to administrators, I wouldn't suggest that you let anonymous users have the "access all webform results" permission, because it lets them see all the submissions by all users on all webforms. I believe that if you manually specify a component to be shown in your e-mail templates, this will take precedence over permissions and always be shown (so for example put %email[hidden] or %value[hidden] in your template).

ermannob’s picture

Thanks for your reply.
I understand that mine is not a solution at all.
Anyway I don't see why a hidden field should be excluded by an email notification (that for my website is emailed right to an admin! :-)

Thanks for the tips.

DrupalKing’s picture

I'm not seeing the hidden fields in my results page nor in my emails. I've tried calling the hidden field manually in the confirmation email template as well as just using %email_values to show all. Any ideas?

ermannob’s picture

@quicksketch: hidden fields are not accessible in email template.
I tried with %value[my_hidden_field] and %email[my_hidden_field], but got no data. Any other hints?

Thanks.

ermannob’s picture

I had to use this workaround:
components/hidden.inc:85

// '#access' => user_access('edit all webform submissions') || user_access('access all webform results'),

I just commented out that line! :-)

afeldinger’s picture

I'm having the exact same problem. I'm using ermannob's workaround for now, but disabling field permissions is probably not the correct way to go.

Hope it's not a big problem.

andrewbenkard’s picture

I had a similar problem to this; it may not be the same problem but I am posting my fix here for the greater good.

I set up a form to be used by anon users. When the form was completed the outbound email only contained the "Email Address" field.
Fields were apparently "missing".
The problem? On the Form Components subtab (node/#/edit/components) I had interpreted the "Email" checkbox to mean that that field was an email address -- for validation or hygeine or something.
Turns out that checkbox was instead "send this value in the outbound email". hurrrr derp derp derp.
So I checked em all, all fields appear in email, problem solved.

Apols for the hijack. We return to your regularly scheduled bug.

quicksketch’s picture

Category: support » bug
Status: Active » Fixed
FileSize
1.1 KB

ermannob was right about this problem. That line is an incorrect check. It's only showing hidden elements in the sent e-mails if the user filling out the form is an administrator, which doesn't make sense. Right now we don't have the appropriate APIs in place to conditionally show an element only to administrators and only in some situations. So for now I'm putting in place a temporary solution until we implement #313639: Public vs. private components , which would provide the necessary functionality on all components.

This patch has been applied and will be in the beta 6 version I'm releasing shortly

quicksketch’s picture

Title: missing hidden components in emails when anonymous users submit » Missing hidden components in emails when anonymous users submit

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

twooten’s picture

Just a quick note to let others know that the file that needs to be patched is webform/components/hidden.inc
Seems to be working fine for 6.x-3.2 (August 26 2010)

Thanks Quicksketch!

Tim

oxcoda’s picture

Version: 6.x-3.0-beta5 » 6.x-3.6
Status: Closed (fixed) » Active

I am reopening this as it still appears to be an issue (in 6.x-3.6) as this looks like it has auto closed.

Thanks!

maikeru’s picture

Same issue.

I'm thinking its because I've set up mimemail, which is in a 'html' format. (The patch checks against the format being HTML)

quicksketch’s picture

Version: 6.x-3.6 » 6.x-3.0-beta5
Status: Active » Closed (fixed)

I'm thinking its because I've set up mimemail, which is in a 'html' format. (The patch checks against the format being HTML)

Yes I think you're correct. When I made this patch we didn't support MIME Mail at all. Now if the e-mail is sent in an HTML format the hiddden fields will not show up unless it's an administrator sending the e-mail.

I'm reclosing this issue since this is now a new (but related) problem. Let's move this new problem to #1066374: Missing hidden components in emails when using MIME Mail.