Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal 7 added the format_username
function for displaying full user names instead of login ids.
--- a/login_one_time.module
+++ b/login_one_time.module
@@ -249,7 +249,8 @@ function login_one_time_button_form($form, $form_state, $username =
'#type' => 'value',
'#value' => $username,
);
- $button_text = t('Send login one time link to !username', array('!username' => $use
+ $account = user_load_by_name($username);
+ $button_text = t('Send login one time link to !username', array('!username' => form
}
else {
$form['account'] = login_one_time_users_widget();
Comment | File | Size | Author |
---|---|---|---|
#1 | login_one_time_button_form-format_username-1246342-1.patch | 1.03 KB | pillarsdotnet |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedPatch.
Comment #2
danielb CreditAttribution: danielb commentedI think we should check_plain() the result, or use the @ placeholder in t(). This is advised in the comments for format_username().
The other problem is then this will be inconsistent with the list of user options given by login_one_time_user_options(), however using format_username here may produce unexpected behaviour with the autocomplete widget?
I'll mess around with it when I get a chance.
Comment #3
danielb CreditAttribution: danielb commentedI've chucked that in now.