I needed this for a project. Before I port it to Drupal 6 I need to know if this is going to be accepted.
Thanks
Robert
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | webform.353748.patch | 10.19 KB | Grayside |
| #22 | webform-defaults.png | 158.83 KB | quicksketch |
| #5 | d5_webform.patch | 6.13 KB | rmiddle |
| #5 | d6_webform.patch | 5.84 KB | rmiddle |
| d5_webform.patch | 6.37 KB | rmiddle |
Comments
Comment #1
rmiddle commentedComment #2
quicksketchOoo, interesting. If I understand correctly, this patch make the username and e-mail address the "from address"? I'm not sure where passwords come into play.
This looks like a good approach, but it's worth mentioning that you can do this anyway with two hidden fields with the default values of %username and %usermail, then use those component as the From name and e-mail. Regardless, this might be a nice shortcut. What happens when the user is not logged in?
Comment #3
rmiddle commentedquicksketch,
The title made since when I wrote it? I ment email address not password.
%usermail doesn't work because the validation function doesn't allow it. We could update the Validation function to allow support for that variable but it would still be a lot harder for a user to find. I think I did try using %username at one point but it didn't work although I am pretty certain that was a typo on my part not something that doesn't work as it works when I tried it after create this patch.
When the user isn't logged in or in the off change there is no email address defined. I my case it happens sometimes because someones AD account doesn't have one set. Then it will fall back to webform's system wide defaults.
Thanks
Robert
PS. I noticed I left 1 line of debuging code in there. If you think the idea has merit I will update the 5.x patch when I submit a 6.x patch.
Comment #4
quicksketchYep, I think this would be a good enhancement. If you can tidy up the enhancement and port it to 6 I'd be happy to commit it.
Comment #5
rmiddle commentedHere is the lastest D5 & D6 patch against CVS.
Comment #6
rmiddle commentedThis patch has been used on my live site for over a month now with no visible problems.
Comment #7
rmiddle commentedBumping to the top of the list to see if quicksketch will have a change to add the update.
Thanks
Robert
Comment #8
quicksketchThanks rmiddle, this code all looks fine to me. Sorry I've been completely swamped trying to get stable versions of FileField and ImageField released. Next time I'm working on Webform patches I'll add this in.
Comment #9
hass commentedThere is one small bug inside a translatable string.
t('Use submitter\'s information if anonymous users use default.')need to be changed tot("Use submitter's information if anonymous users use default.")Comment #10
quicksketchWell now this has taken so long we're not working on 2.x anymore. Moving to the 3.x queue. Thinking of an alternative, we could just run _webform_filter_values() on the e-mail values, meaning you could just set the e-mail to %useremail and from to %username, then we wouldn't need to add another radio button at all.
Comment #11
strider72 commentedI would very much like to see this working when the submitter is not logged in. I use web forms on a public site -- the only "Users" on the site are the admins, so forms are always submitted by people not logged in.
I would like to have an "email" field, and if (!) it is filled in, that is the return address on the email.
(As a side note-- I'm a bit confused. Why do so many Drupal updates linger for so long? This apparently had a working patch for **over a year** ready to be committed, and then "Whups -- too late!" Does Drupal just not have enough committers to go around?)
Comment #12
quicksketch@strider72: Webform is pretty much maintained just by myself, and I also maintain a dozen other modules and make regular contributions to core. Since I don't actually use Webform on a regular basis, the features that get reviewed and go into Webform are frequently added based on the time I have available. So yes, there is a dearth of reliable committers that are able and willing to contribute their time, especially since it's done in free time and rarely paid for.
Comment #13
quicksketchAlso, still not going into 2.x, this is a 3.x only feature since 2.x is nearly at the end of its rope.
Comment #14
strider72 commented@quicksketch: As a contributor to WordPress (and several plugins for it), I appreciate the nature of free open source coding. ;-)
I guess I'm just surprised that this particular one only has one person maintaining it, as web forms are such a *basic* thing I would think there was a huge demand for this module.
Either way, thanks for plugging away at this (so to speak). Perhaps when I have a better understanding of the Drupal plugin API I'll contribute to this plugin.
Comment #15
Grayside commentedTo clarify, the current intent is to use Webform's Token system for From: email configuration? I will roll a patch to that effect.
As an aside, is there a reason this does not use the Token module?
Comment #16
quicksketchHi Grayside, yes I believe the current direction is my suggestion in #10:
Regarding token.module, see #428982: New hooks for additional token replacements.
Comment #17
Grayside commentedOkay.
I see that the email subject is using a %title token by default. This does not appear in theme_webform_token_help(). Does that mean it is not part of the webform token system?
Comment #18
quicksketchThe help is not based on the actual tokens available (though it tries to include all of them). The best thing is to check _webform_filter_values() and see what tokens are available there. %title should be added to the list of tokens in the help.
Comment #19
Grayside commentedLooking at this, I see there are global email settings at admin/settings/webform, and also email settings at node/#/webform/emails. However, the settings of the latter do not seem to be pulling global defaults.
What do you want here?
Comment #20
quicksketchThe global settings are just the defaults, they're never used directly they just set the defaults for new e-mails.
Comment #21
Grayside commentedRight, but the webform-specific email settings are not pulling the global defaults in as defaults, they are using the same sitename/siteemail used in a vanilla install. So either there is a bug, or I have no idea what the Email From: settings do in the main settings form.
Comment #22
quicksketchMaybe this screenshot will help.
The improper ordering of subject, from, and email should probably be fixed at some point. :-)
Comment #23
Grayside commentedThanks. So that confirms that what I see looks like a bug. When I save those settings to admin/settings/webform, they are not used as defaults on the specific webform's email configuration.
I will confirm that and create a separate issue as needed.
Comment #24
Grayside commentedOkay, what I'm seeing is a UI issue with filtering the tokens to build the email address/etc in building the UI. Back on forward momentum.
webform_format_email_address() in webform.module applies filters the email addresses. This creates confusing UI where the webform administrator sees the processed tokens, such as their own email address. Since there are already so many arguments going into this function, I wanted to ask: is a preference on how to conditionally skip token filtering?
Comment #25
quicksketchAh interesting. It sounds like webform_format_email_address() shouldn't be getting called at all then if you're wanting to show the original tokens and not the final e-mail address? If you can make a generic attempt at fixing the problem I'll see if it makes sense, it'd also help me understand the problem fully.
Comment #26
Grayside commentedHm, I never thought about not calling it. I assumed if there were no tokens the rest of that function did desirable things. I think it's important in the node/#/webform/emails page that if the form creator used %useremail, he's not confused by seeing his own email address.
Comment #27
Grayside commentedOkay, now accepting tokens for email address configuration.
This did not require touching the actual email submission system, as that already checks for tokens.
Summary of Changes:
Comment #28
YK85 commentedsubscribing
Comment #29
quicksketchSo I'm reviewing old patches now and finally took another look at this issue. I don't like all the new parameters added by the patch in #27. We've already got 5-7 parameters on these functions and adding more just makes our code more difficult to follow. The overall effect of the patch doesn't seem to make things easier to understand, though it would provide a shortcut for advanced users. Overall I'm not sure there's a net-gain for this patch.
Comment #30
quicksketchMoving this to needs work pending any feedback. Right now I'm leaning towards won't fixing this issue.
Comment #31
danchadwick commentedThere won't be further feature development in the X.x-3.x branches.