It'd be nice if the default logic in email_registration_user() when no module implements hook_email_registration_name() lived in a separate helper function instead of being embedded directly into email_registration_user(). That'd make it easier to write unit tests for it, and it'd allow someone to reuse the same logic when importing users via migrate module, for example.

Comments

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
StatusFileSize
new2.55 KB
greggles’s picture

Seems reasonable to me though I'm not sure if the abstraction should work the way it does or if it should include the call that invokes the hooks of other modules.

That is, if a site has setup a email_registration and written a hook that changes the way names are generated then I would expect that hook to be used if they called this function directly.

dww’s picture

Status: Needs review » Needs work

Ahh, good point.

greggles’s picture