FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit eb1cb4ea authored by Chris Wilkinson's avatar Chris Wilkinson
Browse files

Merge pull request #12 from thewilkybarkid/real-name-emails

Update Real Name to 1.2 and correct usernames appearing in default emails
parents 894c993d 995f0401
No related branches found
No related tags found
No related merge requests found
...@@ -219,6 +219,9 @@ function cambridge_install() { ...@@ -219,6 +219,9 @@ function cambridge_install() {
->condition('name', $name) ->condition('name', $name)
->execute(); ->execute();
} }
// Fix usernames in emails
cambridge_update_7101();
} }
/** /**
...@@ -237,3 +240,39 @@ function cambridge_update_7100() { ...@@ -237,3 +240,39 @@ function cambridge_update_7100() {
variable_set('menu_trail_by_path_breadcrumb_handling', FALSE); variable_set('menu_trail_by_path_breadcrumb_handling', FALSE);
} }
/**
* Stop names appearing where usernames should in emails.
*
* See https://drupal.org/node/1827980
*/
function cambridge_update_7101() {
global $conf;
if (FALSE === module_exists('realname')) {
return;
}
$emails = array('register_admin_created_body', 'register_no_approval_required_body', 'status_activated_body');
foreach ($emails as $email) {
$key = 'user_mail_' . $email;
$current_variable = variable_get($key);
$conf[$key] = FALSE; // temporarily hide a customised message
$default_message = _user_mail_text($email, NULL, array(), FALSE); // find the default
$conf[$key] = $current_variable; // revert back
$current_message = _user_mail_text($email, NULL, array(), FALSE); // find the current
$current_message = preg_replace('~\R~u', "\n", $current_message); // normalise line endings
if ($current_message === $default_message) {
// only change cases where the message is still Drupal's default
$new_message = str_replace('username: [user:name]', 'username: [user:name-raw]', $default_message);
variable_set($key, $new_message);
}
}
}
...@@ -46,7 +46,7 @@ projects[menu_force] = "1.2" ...@@ -46,7 +46,7 @@ projects[menu_force] = "1.2"
projects[menu_trail_by_path] = "2.0" projects[menu_trail_by_path] = "2.0"
projects[nodequeue] = "2.0-beta1" projects[nodequeue] = "2.0-beta1"
projects[pathologic] = "2.12" projects[pathologic] = "2.12"
projects[realname] = "1.1" projects[realname] = "1.2"
projects[redirect][version] = "1.0-rc1" projects[redirect][version] = "1.0-rc1"
projects[redirect][subdir] = "patched" projects[redirect][subdir] = "patched"
projects[redirect][patch][] = "http://drupal.org/files/redirect-prevent_circular_redirects-1817976-42.patch" projects[redirect][patch][] = "http://drupal.org/files/redirect-prevent_circular_redirects-1817976-42.patch"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment