Commit 4551ebfb authored by omega8cc's avatar omega8cc

Always use Drush specific dt() wrapper for not always available Drupal t() function.

Without this change some tasks may fail with error: Drush command terminated abnormally due to an unrecoverable error. Error: Call to undefined function t() in /data/disk/o1/.drush/provision/platform/verify.provision.inc, line 92
parent 955cfc2c
......@@ -169,7 +169,7 @@ function drush_provision_drupal_post_provision_deploy() {
// rebuild the node access tables only if necessary
if (!function_exists("node_access_needs_rebuild") || node_access_needs_rebuild()) {
node_access_rebuild();
drush_log(t('Rebuilt node access table'));
drush_log(dt('Rebuilt node access table'));
}
} else {
drush_log("could not bootstrap drupal after updatedb");
......
......@@ -5,17 +5,17 @@
*/
cache_clear_all();
drush_log(t('Cleared all caches'));
drush_log(dt('Cleared all caches'));
node_types_rebuild();
drush_log(t('Rebuilt node type cache'));
drush_log(dt('Rebuilt node type cache'));
module_list(TRUE, FALSE);
module_rebuild_cache();
drush_log(t('Rebuilt module cache'));
drush_log(dt('Rebuilt module cache'));
system_theme_data();
drush_log(t('Rebuilt theme cache'));
drush_log(dt('Rebuilt theme cache'));
menu_rebuild();
drush_log(t('Rebuilt menu cache'));
drush_log(dt('Rebuilt menu cache'));
......@@ -6,13 +6,13 @@
module_list(TRUE, FALSE);
module_rebuild_cache();
drush_log(t('Rebuilt module cache'));
drush_log(dt('Rebuilt module cache'));
cache_clear_all('*', 'cache_form', TRUE); // This bin is excluded in drupal_flush_all_caches()
// but if not purged, it may break tasks with
// mysterious errors thanks to garbage collected.
drupal_flush_all_caches();
drush_log(t('All caches flushed'));
drush_log(dt('All caches flushed'));
// function drupal_flush_all_caches() {
// // Change query-strings on css/js files to enforce reload for all users.
......
......@@ -8,7 +8,7 @@ cache_clear_all('*', 'cache_form', TRUE); // This bin is excluded in drupal_flus
// but if not purged, it may break tasks with
// mysterious errors thanks to garbage collected.
drupal_flush_all_caches();
drush_log(t('All caches flushed'));
drush_log(dt('All caches flushed'));
// function drupal_flush_all_caches() {
// // Change query-strings on css/js files to enforce reload for all users.
......
......@@ -5,7 +5,7 @@
*/
drupal_flush_all_caches();
drush_log(t('All caches flushed'));
drush_log(dt('All caches flushed'));
// function drupal_flush_all_caches() {
// $module_handler = \Drupal::moduleHandler();
......
......@@ -100,10 +100,10 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
$mail_success = drupal_mail($mailkey, $client_email, $subject, $body, $from);
if ($mail_success) {
drush_log(t('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
drush_log(dt('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
}
else {
drush_log(t('Could not send welcome mail to @client', array('@client' => $client_email)));
drush_log(dt('Could not send welcome mail to @client', array('@client' => $client_email)));
}
}
......@@ -193,7 +193,7 @@ function install_main() {
$onetime = user_pass_reset_url($account);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option('login_link', $onetime . '/login');
drush_log(t('Login url: !onetime', array('!onetime' => $onetime . '/login')), 'message');
drush_log(dt('Login url: !onetime', array('!onetime' => $onetime . '/login')), 'message');
if ($client_email) {
install_send_welcome_mail($url, $account, $profile, $install_locale, $client_email, $onetime);
......
......@@ -78,10 +78,10 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
$mail_success = drupal_mail('install', 'welcome-admin', $client_email, user_preferred_language($account), $mail_params, $from, TRUE);
if ($mail_success) {
drush_log(t('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
drush_log(dt('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
}
else {
drush_log(t('Could not send welcome mail to @client', array('@client' => $client_email)));
drush_log(dt('Could not send welcome mail to @client', array('@client' => $client_email)));
}
}
......@@ -248,7 +248,7 @@ function install_main() {
foreach ($modules as $module) {
_drupal_install_module($module);
module_enable(array($module));
drush_log(t("Installed @module module.",
drush_log(dt("Installed @module module.",
array("@module" => $files[$module]->info['name'])));
}
......@@ -356,7 +356,7 @@ function install_main() {
$onetime = user_pass_reset_url($account);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option('login_link', $onetime . '/login');
drush_log(t('Login url: !onetime', array('!onetime' => $onetime . '/login')), 'message');
drush_log(dt('Login url: !onetime', array('!onetime' => $onetime . '/login')), 'message');
if ($client_email) {
install_send_welcome_mail($url, $account, $profile, $install_locale, $client_email, $onetime);
......
......@@ -25,10 +25,10 @@ function install_send_welcome_mail($url, $account, $language, $client_email, $on
$mail_success = drupal_mail('install', 'welcome-admin', $account->mail, user_preferred_language($account), $mail_params, $from, TRUE);
if ($mail_success) {
drush_log(t('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
drush_log(dt('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
}
else {
drush_log(t('Could not send welcome mail to @client', array('@client' => $client_email)));
drush_log(dt('Could not send welcome mail to @client', array('@client' => $client_email)));
}
}
}
......@@ -152,7 +152,7 @@ function install_main() {
$onetime = user_pass_reset_url($account);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option('login_link', $onetime . '/login');
drush_log(t('Login url: !onetime', array('!onetime' => $onetime . '/login')), 'message');
drush_log(dt('Login url: !onetime', array('!onetime' => $onetime . '/login')), 'message');
if ($client_email) {
install_send_welcome_mail($url, $account, $install_locale, $client_email, $onetime);
......
......@@ -25,10 +25,10 @@ function install_send_welcome_mail($url, $account, $language, $client_email, $on
$mail_success = drupal_mail('install', 'welcome-admin', $account->mail, user_preferred_langcode($account), $mail_params, $from, TRUE);
if ($mail_success) {
drush_log(t('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
drush_log(dt('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
}
else {
drush_log(t('Could not send welcome mail to @client', array('@client' => $client_email)));
drush_log(dt('Could not send welcome mail to @client', array('@client' => $client_email)));
}
}
}
......@@ -152,7 +152,7 @@ function install_main() {
$onetime = user_pass_reset_url($account);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option('login_link', $onetime . '/login');
drush_log(t('Login url: !onetime', array('!onetime' => $onetime . '/login')), 'message');
drush_log(dt('Login url: !onetime', array('!onetime' => $onetime . '/login')), 'message');
if ($client_email) {
install_send_welcome_mail($url, $account, $install_locale, $client_email, $onetime);
......
......@@ -29,7 +29,7 @@ function drush_provision_drupal_provision_login_reset() {
$onetime = user_pass_reset_url($account) . '/login';
// pass the login link to the front end
drush_set_option('login_link', $onetime);
drush_log(t('Login url: !onetime', array('!onetime' => $onetime)), 'message');
drush_log(dt('Login url: !onetime', array('!onetime' => $onetime)), 'message');
if (drush_drupal_major_version() >= 7) {
drupal_session_destroy_uid(1);
......
......@@ -89,7 +89,7 @@ function drush_provision_drupal_pre_provision_verify() {
}
}
$latestDir = max($sortedDirs);
drush_log(t('Contrib latestDir: !latest', array('!latest' => $latestDir)), 'message');
drush_log(dt('Contrib latestDir: !latest', array('!latest' => $latestDir)), 'message');
if (is_numeric($latestDir)) {
$core6_contrib_dir = '/data/all/' . $latestDir . '/o_contrib';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment