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.
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
Comment | File | Size | Author |
---|---|---|---|
#10 | webform_hidden_email.patch | 1.1 KB | quicksketch |
Comments
Comment #1
ermannob CreditAttribution: ermannob commentedSorry, I missed an important information: this problem exists only when anonymous users submit my webform.
Comment #2
ermannob CreditAttribution: ermannob commentedI found a solution: I have to let anonymous users "access all webform results".
Well... is that a proper solution? :-)
Thanks.
Comment #3
quicksketchThis 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).
Comment #4
ermannob CreditAttribution: ermannob commentedThanks 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.
Comment #5
DrupalKing CreditAttribution: DrupalKing commentedI'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?
Comment #6
ermannob CreditAttribution: ermannob commented@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.
Comment #7
ermannob CreditAttribution: ermannob commentedI 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! :-)
Comment #8
afeldinger CreditAttribution: afeldinger commentedI'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.
Comment #9
andrewbenkard CreditAttribution: andrewbenkard commentedI 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.
Comment #10
quicksketchermannob 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
Comment #11
quicksketchComment #13
twooten CreditAttribution: twooten commentedJust 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
Comment #14
oxcoda CreditAttribution: oxcoda commentedI 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!
Comment #15
maikeru CreditAttribution: maikeru commentedSame 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)
Comment #16
quicksketchYes 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.