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.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | drupal-comment.module-rememberme-4.7.diff | 3.42 KB | msameer |
| #16 | drupal-comment.module-rememberme.diff | 2.56 KB | msameer |
| #11 | drqhist.patch | 3.09 KB | moshe weitzman |
| #3 | dranon_comment.patch | 3.62 KB | moshe weitzman |
Comments
Comment #1
jibbajabba commentedFurther discussion from Drupal users can be found here.
Comment #2
moshe weitzman commentedpatch attached ... and i don't even approve of anonymous commenting :)
no javascript. adds a new cookie called 'comment_anon'
Comment #3
moshe weitzman commentedsigh.
Comment #4
Steven commentedCan'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)
Comment #5
moshe weitzman commentedhmmm. that seems like a good idea. by default, how long does the session cookie persist?
Comment #6
dries commentedWe 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.
Comment #7
larssg commentedI was under the impression that sessions persist until the browser window is closed. Am I missing something here?
Comment #8
dries commentedYes, read up on sessions in the PHP manual.
Comment #9
larssg commentedOkay, 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.
Comment #10
gábor hojtsyPlease use sessions, user info shoul not be stored in cookies...
Comment #11
moshe weitzman commentedthis time using $_SESSION as suggested by Steven
Comment #12
(not verified) commentedHow 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.
Comment #13
DaveNotik commentedThis ever make it into the code?
Comment #14
psicomante commentedi'm interested to this feature.
Comment #15
moshe weitzman commentedComment #16
msameer commentedworks fine here, Can someone please review it ?
It's against 4.6 and I'm welling to port it to 4.7 CVS.
Comment #17
msameer commentedSorry, I broke the title by mistake.
Comment #18
moshe weitzman commenteddiff 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.
Comment #19
msameer commentedRight 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.
Comment #20
luperry commentedI 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.Comment #21
luperry commentedadding a
settype($_SESSION['comment_anon'], 'array');just before the line seems fixed the problem.Comment #22
cosmicdreams commentedJust thought I'd touch on this issue. What has changed on this since last comment?
Comment #23
gábor hojtsyDrupal 6 includes this functionality already.
Comment #24
mykle commentedi need this feature too, but i'm in drupal 5. what would it take to port this patch?
Comment #25
Sepero commented"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?
Comment #27
oadaeh commentedResetting stats.