| Project: | Drupal core |
| Version: | 6.9 |
| Component: | comment.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
The new fields for Name, Email and Home Page in anonymous comments is a welcome addition. However, the absence of a "Remember me" function forces users to enter this information repeatedly with each comment they wish to enter on a Drupal system.. Users of MT have long had the ability to click a "Remember me" checkbox so that each time they return to a site, their Name, Email and Homepage address are automatically filled into the comment form. The MT method used JavaScript to set a cookie that is read back into the form inputs. Providing a checkbox to set a cookie and remember the user's information should be a requirement for anonymous comments to allow them to bypass this step upon return.
In a usability analysis, this issue would fall under the "Flexibility and efficiency of use" category.
Comments
#1
Further discussion from Drupal users can be found here.
#2
patch attached ... and i don't even approve of anonymous commenting :)
no javascript. adds a new cookie called 'comment_anon'
#3
sigh.
#4
Can't this be done in a cleaner fashion using $_SESSION? Just something like:
if (!isset($_SESSION['comment_anon'])) {
$_SESSION['comment_anon'] = array('name' => ..., 'email' => ... ,...);
}
and
$edit = array_merge($_SESSION['comment_anon'], $edit);
(values in $edit will overwrite values in $_SESSION)
#5
hmmm. that seems like a good idea. by default, how long does the session cookie persist?
#6
We should use sessions. Sessions are cookies-made-easy. They persist as long they are configured to persist. With Drupal's default .htaccess file that is 3 months.
#7
I was under the impression that sessions persist until the browser window is closed. Am I missing something here?
#8
Yes, read up on sessions in the PHP manual.
#9
Okay, then. I can see that sessions can be made to persist across browser sessions. But you do this through .htaccess which does not work on IIS and some Apache servers are configured to ignore .htaccess.
My point is, using cookies as in the original patch would make this work without tinkering with the webserver and without requiring .htaccess-files to be enabled.
I do agree, though, that using sessions would make the code cleaner.
#10
Please use sessions, user info shoul not be stored in cookies...
#11
this time using $_SESSION as suggested by Steven
#12
How does this work exactly? I installed the patch and when adding an anonymous comment (logged out) don't see a "Remember me" checkbox and my info isn't saved.
#13
This ever make it into the code?
#14
i'm interested to this feature.
#15
#16
works fine here, Can someone please review it ?
It's against 4.6 and I'm welling to port it to 4.7 CVS.
#17
Sorry, I broke the title by mistake.
#18
diff looks good. note that braces should appear on the same line as if().
please do port to HEAD. note that the form api has landed there and the patch will be quite different.
#19
Right on!
Sorry for the braces and I hope I didn't break anything else.
I've tested the patch on my local installation and it worked fine.
#20
I just patched my comment module using the 4.7 patch. and I'm getting this warning:
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/.doublestuff/luperry/luperry.com/modules/comment.module on line 887.#21
adding a
settype($_SESSION['comment_anon'], 'array');just before the line seems fixed the problem.#22
Just thought I'd touch on this issue. What has changed on this since last comment?
#23
Drupal 6 includes this functionality already.
#24
i need this feature too, but i'm in drupal 5. what would it take to port this patch?
#25
"Drupal 6 includes this functionality already."
I did an anonymous post on my D6 installation and it is not remembering the username entered. Do I have to somehow enable this behavior?
#27
Resetting stats.