Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
contact.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Nov 2007 at 15:40 UTC
Updated:
30 Jan 2008 at 12:52 UTC
Jump to comment: Most recent file
After submitting an email on the /contact page, I see the following notice:
notice: Undefined index: copy in /web/test/modules/contact/contact.pages.inc on line 132.
Of interest: UID 1 is apparently limited in the number of messages it can send per hour just as any other user; I'm not certain if this is a feature or a bug, but likely it belongs in a different issue, if there isn't one already.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | personal-contact-denied-anonymous-692372-7.patch | 593 bytes | dropcube |
| #6 | personal-contact-form-fix-692372-5.patch | 5.33 KB | dropcube |
| #3 | contact_notice_189785.patch | 1022 bytes | greggles |
Comments
Comment #1
gregglesWere you an anonymous user when that happened or a logged in one?
I only get the error if I'm anonymous.
This I created a patch which avoids this error, but then got new errors from lines seems to block the anonymous user:
So, is that on purpose? I'm not sure how to handle it now that we've hit string freeze because the only solutions I see will add strings: either prompts for the username/email if we let them enter it on the form or a warning message.
Thoughts?
Comment #2
keith.smith commentedI no longer get this error when I'm logged in. However, as an anonymous user accessing the /contact page (after having given a permission to anonymous to be able to do that), I get:
Comment #3
gregglesSo, I previously thought that anonymous users should be able to use the user/UID/contact forms but apparently that is not the case (I looked at Drupal5 to be sure). So, this patch fixes the error without trying to make the user/UID/contact form accessible to all.
Basically, ignore my comment #2 and just review/apply this patch :)
Comment #4
dropcube commentedAfter applying the patch at #3, Anonymous (non logged) users can not use the user's contact form and a confusing message is showed up:
You need to provide a valid e-mail address to contact other users. Please update your user information and try again.Anonymous users do not have "user information" (in fact, the link goes to an access denied page) .
We have to chose:
Form me 3 seems more flexible and reasonable.
I am working on a patch to implement 3
Comment #5
gregglesFor drupal 6 changing functionality and adding strings to the interface is probably not going to happen so I think that #3 is out.
Anonymous users have never been able to use personal contact forms (at least not in 5.x) so I think we should implement #2 by fixing that message about providing a valid e-mail address to instead do a "drupal_access_denied()".
Comment #6
dropcube commentedAdding a permission 'contact users if they allow' the site administrators will be able to allow/restrict the access to users' personal contact forms. This way, if allowed, Anonymous users will be able to contact users throughout their personal contact page.
- In the patch, the original errors reported in this issue have been fixed.
- The access callback for this page now checks if the current user have permission to contact users and if the user to be contacted has his/her personal contact form enabled.
- The message
You cannot contact more than %number users per hour. Please try again later.IMHO is not correct. There is no difference in using the site-wide contact form and users personal contact forms (variable contact_hourly_threshold) . So, a user trying to use a personal contact page for first time may get a message like this even when s/he has not contacted any user. So, the message should be the same of the site-wide contact page:You cannot send more than %number messages per hour. Please try again later.To reproduce while testing:
- Enable contact.module
- Go to admin/user/permissions and set permissions to anonymous-user/authenticated-user such that the personal contact forms may be used.
- Enable the personal contact form in at least one user
- Try to contact the user anonymously (logged out)
- Try to contact the user logged in
Please test and provide comments or suggestions.
Comment #7
dropcube commentedI posted the patch at #6 without reading this. Anyway, the patch is there.
Well, if Anonymous users will not be able to use personal contact forms, in my opinion the best if denied the access completely and do not allow them to access the page.
The patch attached modifies the access callback function to achieve this.
Comment #8
ximo commentedI came across this bug as well, good to see that it has already been looked into.
I support #2 as well, and the lates patch does just that. It works fine, and is RTBC as far as I can see.
Comment #9
gábor hojtsyThanks, committed #7, that one looks logical.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.