Closed (fixed)
Project:
Username originality AJAX check
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Jul 2008 at 15:19 UTC
Updated:
10 Dec 2008 at 12:22 UTC
Jump to comment: Most recent file
Comments
Comment #1
timmillwoodI'm just installing, let you know how it goes!
Comment #2
timmillwoodWorks, although I think the check button should be next to the username checkbox and the message should come back as a drupal_set_message()
Comment #3
atuyo60 commentedHi, thanks for your suggestions and testing. The button issue was discussed previously in the Drupal 5 version and apparently there is no real solution to that as it seems to be a limitation of the core. You can still check out the discussions and see what solution suits your needs. My implementation here is just a slight improvement on the original. I was personally trying to do what you suggested as well but it seemed too much work for such a small cosmetic issue so in the end I abandoned that.
As for the message, what do you wish to achieve with using drupal_set_message? This is an AJAX checker and it is not meant to be submitted so if you are using drupal_set_message, the user cannot know the error until the page is refreshed or submitted.
Comment #4
timmillwoodI was thinking drupal_set_message puts the message in a place users should be familiar with, themed in a way they are familiar with. If drupal_set_messages can't be set / displayed via ajax then I guess its not an option.
Comment #5
burgs commentedI think there needs to be some javascript to do this checking automagically whilst the user is typing - but all in good time.
For now, to get the button into a better position the username_check_path_form function in username_check.module needs to be changed. The change below works:
Comment #6
burgs commentedOk, here is an update zip of the module, for Drupal 6, with keypress checking (no button to click), and a proper checking for invalid usernames.
Also, some re-placement of the text to sit just below the username textbox.
Thanks to atuyo60 for doing the hard yards.
Comment #7
sdsheridan@burgs: Thanks for this! Much better positioning. I also added a '#weight' array element so that I could get it above the eMail and confirmation eMail boxes that logintoboggan provide, and adjusted the weight values in logintoboggan's hook_form_alter function for the 'user_registration' case so that the button appears just below the username field (in case this applies to anyone else).
shawn
Comment #8
timmillwoodThis should be core!
One idea would be to outline the textbox if unavailable, like drupal does with required fields.
Comment #9
Flying Drupalist commentedawesome, am trying this. Thank you.
Comment #10
andreBerlin commentedChanges in d6 form handling seems to cause issues with the provided patch. The array keys are wrong.
Furthermore it is quite expensive to check the username every time on key up. I changed it a bit and now the check is performed only onblur, e.g on clicking in the mail-input.
Hope, that helps :)
André
Comment #11
Flying Drupalist commentedThank you!
This version doesn't work outside of user/register though. So in my panel which combines the user login and register page, it doesn't work.
Can this module also check for usernames in the access denied section?
Comment #12
atuyo60 commentedhi, regarding the wrong array keys issue, are u referring to the version i first posted ? cos I do not seem to be having problems with it yet...
Comment #13
ardas commentedThank you guys for all work you did. We have ported this module to Drupal 6 and added features you proposed. The release will be ready soon. Please download it and test.