Closed (fixed)
Project:
Email Registration
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 May 2014 at 16:45 UTC
Updated:
20 Aug 2015 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gregglesComment #3
smichel commentedFWIW, the patch in #1 worked for me. Thanks @greggles!
Comment #4
greggles@smichel hopefully you can just use latest 7.x-1.2 release which has this patch in it.
Comment #5
smichel commentedThanks, @greggles, that version is working for me now.
Comment #6
thegreatone commentedI have the 7.x-1.2 release and don't see the code in there.
Also...in order to make it work like the module says it does:
"For example, "johndoe@a.example.com" would be assigned username "johndoe", "johndoe@b.example.com" would be assigned "johndoe_1" and so forth"
the line
if (!empty($uid)) {
// Put uid on the end of the name.
$name = $name . '_' . $uid;
}
in function email_registration_cleanup_username
need to be removed. Else if add the uid to every user even if the username don't exist already.
Correct?
Comment #7
awardell commentedThe 2257201_optional_uid.patch did not work for me. The fix was rather simple in fixTrailingUID-2257201.patch. It seems that the function email_registration_user_insert does everything needed to UID. Maybe I'm missing something?
Comment #8
gregglesThe behavior removed by the patch in comment #7 was intentionally added in #423920: [2.x] Prevent race condition in account generation code by adding uid to name so I don't think removing it is the right solution.
Comment #9
evilehk commentedI was experiencing the race condition issue from #423920: [2.x] Prevent race condition in account generation code by adding uid to name, so thank you for that commit! As a result of it, I found that my project had custom code looking if email_registration was enabled and using the email_registrartion_unique_username method, treating the $uid argument as optional.
At the very least, the (optional) comment should be removed from the phpdoc comment of that method. That is what this patch does. I will also follow up with an additional patch with the suggestion for modules to prepend 'email_registration_' to an account name about to be saved to initiate the hooks in the email_registration module, thus avoiding the race condition.
Comment #10
evilehk commentedThis patch adds additional comments to the email_registration_unique_username method that custom module can take advantage of the email_registration user hooks by saving a user with a user name prepended with 'email_registration_'.
Comment #11
dxxOk for me.
Comment #13
gregglesCommitted and pushed. Thanks!
Comment #16
njbarrett commentedThis patch was not properly committed to 7.x-1.x-dev.
evilehk's patch only contained comment changes not the original patch changes.
Comment #17
njbarrett commentedThis patch fixes the problem the original issue was created for: make the uid parameter optional in email_registration_unique_username
Comment #19
gregglesGood point, thanks njbarrett! Now committed.