Closed (fixed)
Project:
Comment Notify
Version:
5.x-2.x-dev
Component:
User interface
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2008 at 00:31 UTC
Updated:
11 Mar 2010 at 00:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
gregglesHere's a patch which also fixes some whitespace issues and a notice.
Comment #2
gregglesApplied to 6.x-1.x.
Comment #3
aclight commentedHere's a direct port for D5.
However, I'm -1 on the change this patch makes.
First of all, the message is "You can change the default for this field in...". What field? As a user, I see this message and will have no idea what the message means.
Second of all, this message is displayed each time the user posts a comment. If I was able to figure out what the message meant the first time, I probably don't need it to be displayed to me every time I post a comment on that site.
But if you want to keep the two branches in sync this patch should do it.
Comment #4
greggles@aclight - great points. First, I think it is only shown if the user does not have a default setting"
if (empty($user->comment_notify_mailalert) && $comment['notify']) {Won't the empty() test ensure it only gets shown until they set a default?
That said, I totally agree that the message should be changed. How about:
to become:
Thoughts?
Comment #5
aclight commentedYeah, it looks like it should only be displayed if no default has been chosen, but why pester a user over and over to set a default in the first place? I'd be fine doing this the first time a user posts a comment, but after that never giving the message, but doing this would require storing whether or not the user had been shown the message before, which complicates the module unnecessarily.
The original issue doesn't explain why this change was suggested/made in the first place, but I'm guessing it was to simplify that form element. However, I really don't think that the usability is improved by removing information about a form element and then displaying a message at a later time.
Comment #6
gregglesThis was on the advice of alpritt in http://groups.drupal.org/node/15456 from the usability group.
It's certainly debatable whether it should be on the form or after submission. Generally speaking Drupal follows a pattern of telling users about the success/failure of an action that they have just performed "Your blog %title was created" for example. I think it makes sense to say something to the effect of "You will get comment notifications - you can make this your default" both to limit the complexity of the form and to follow the pattern of other parts of core.
Comment #7
aclight commentedI'd actually rather see this done using radios/checkboxes, but I see there's already an issue for this at #320224: Use check box to subscribe if only one subscription mode is available, radios otherwise, near the mailbox. I'll post a follow up there.
I see the point about how a user might click on a "make this my default" link on the comment form itself, and lose the comment. But I still really dislike excessive use of dsm().
Probably continuing discussion at #320224: Use check box to subscribe if only one subscription mode is available, radios otherwise, near the mailbox for now is best.
Comment #8
gregglesI was torn about this, but I think I've now got an idea.
My main problem with this is that I still wanted control over this in my account area and didn't want the form to override my selection.
Solution: it should only set the default for a user if there is no default :)
What do you think?
Also, I think that this issue needs to be solved before the next release so I'm bumping the priority.
Comment #9
aclight commentedI think that behavior would be fine. But with regards to my mockup in #320224-4: Use check box to subscribe if only one subscription mode is available, radios otherwise, near the mailbox (http://drupal.org/files/issues/comment_notify_comment_settings.png), the text would need to change, presumably to something mentioning the possibility of setting the per-user default, which then brings us back to the same problem of having a link that might take the user away from the form they are filling out.
I agree that this would be a good thing to get fixed before the next release.
Comment #10
gregglesSo...I'm debating about how to implement this change.
In order to do this right now (because comment_notify saves data in $user->data) we would have to do a user_save which I'm not entirely comfortable doing...
What I'd rather do is insert a record in a single little table with UID and preference. Updating to that seems like a good thing to do regardless - #348000: stop using the $user->data to store preferences.
Comment #11
aclight commentedPatch in #3:
Setting back to CNW
Comment #12
gregglesChanging title to reflect comments 6 through 9.
Comment #13
gregglesNoyz suggested to me
I like his solution. Thoughts?
Comment #14
aclight commentedLooks good to me
Comment #15
gregglesAnd here's a patch for 6.x... (and screenshot, but it's pretty right on).
Also note the new .css file. I'm not super happy with how I clear the float, but I tried a few other things and they don't work. I figure a real css guru will provide advice soon enough.
Comment #16
gregglesComment #17
gregglesLet's try this again...
Now with 100% more javascript. If the checkbox is blank and a user clicks on the radio button then the JS automatically clicks the "notify me" checkbox.
This also refactors the form_alter to remove my copy paste anti-pattern. Now there is an if condition to test whether the user is anonymous or not and only the unique code is inside the if instead of duplicating code. Should remove a bug (unreported, i think) where the registered user default would be used for anonymous.
Comment #18
gregglesOk, tested this out a bit more and committed it. Now to more fun stuff.
http://drupal.org/cvs?commit=171577
I'll leave this in "to be ported" state for a while. I don't plan to port it myself, but if someone else cares about 5.x then they can do it... (an initial port is attached).
Comment #19
dragonwize commentedEDITED: Sorry, I was testing without the latest update. Seems to be working fine now. Please disregard this.
Small bug with the 6.x patch.
This causes a "warning: Invalid argument supplied for foreach()" error if the user does not have any comments to be notified of in the the table. Need an if wrapped around the foreach.
Comment #20
gregglesThanks dragonwize! I found/fixed that prior to committing and have now turned on notices in my dev environment.
Comment #21
neochief commentedThere are two variables that should be the same in a current 6x-dev version:
comment_notify_default_regged_mailalert
comment_notify_default_registered_mailalert
Comment #22
neochief commentedAlso, it would be nice to add aditional style to place some whitespace between the radiobutons:
#edit-notify-type-2-wrapper {
margin-left: 1em;
}
because under windows, we have such a bad picture:
Comment #23
greggles@neochief - I've committed exactly what you provided to the 6.x branch. Seemed good to me.
Comment #24
neochief commentedYou should also get rid of double variables, as I mentioned in my previous comment (#21). They both present in dev. version currently. Should be only one of them.
(Sorry, I have no ability to make patch at this time by myself)
Comment #25
gregglesYes, but that should be a separate issue. #375378: duplicated variables
Comment #26
greggles(I'm not working on porting...)
Comment #27
gregglesThis module is no longer actively developed for Drupal 5. If someone wishes to take over as the 5.x maintainer I would consider it, but these days everyone should really upgrade to Drupal 6.x.