Commit d17b6ad1 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#199336 by JirkaRybka: remove improper t() use in update code (update goes all...

#199336 by JirkaRybka: remove improper t() use in update code (update goes all in English, but there were some mistakes), and add messages to updates where there was no return value otherwise, so users know what happens in each update
parent 2b811363
......@@ -162,7 +162,7 @@ function book_update_6000() {
// The first orphan becomes the parent for all other orphans.
$book['parent'] = 0;
$_SESSION['book_update_6000_orphans']['book'] = $book;
$ret[] = array('success' => TRUE, 'query' => t('Relocated orphan book pages.'));
$ret[] = array('success' => TRUE, 'query' => 'Relocated orphan book pages.');
}
else {
// Re-assign the parent value of the book, and add it to the stack.
......@@ -237,7 +237,7 @@ function book_update_6000() {
if (empty($_SESSION['book_update_6000'])) {
$ret['#finished'] = TRUE;
$ret[] = array('success' => TRUE, 'query' => t('Relocated existing book pages.'));
$ret[] = array('success' => TRUE, 'query' => 'Relocated existing book pages.');
$ret[] = update_sql("DROP TABLE {book_temp}");
unset($_SESSION['book_update_6000']);
unset($_SESSION['book_update_6000_orphans']);
......
......@@ -55,7 +55,7 @@ function comment_update_6002() {
}
variable_del($setting);
}
return array();
return array(array('success' => TRUE, 'query' => 'Global comment settings copied to all node types.'));
}
/**
......
......@@ -1857,7 +1857,7 @@ function system_update_6013() {
module_rebuild_cache();
system_theme_data();
return array();
return array(array('success' => TRUE, 'query' => 'Cache rebuilt.'));
}
/**
......@@ -1867,7 +1867,7 @@ function system_update_6013() {
function system_update_6014() {
variable_set('install_task', 'done');
return array();
return array(array('success' => TRUE, 'query' => "variable_set('install_task')"));
}
/**
......@@ -1985,15 +1985,16 @@ function system_update_6018() {
if (module_exists('htmlcorrector')) {
module_disable(array('htmlcorrector'));
$ret[] = update_sql("UPDATE {filter_formats} SET module = 'filter', delta = 3 WHERE module = 'htmlcorrector'");
$ret[] = t('HTML Corrector module was disabled; this functionality has now been added to core.');
$ret[] = array('success' => TRUE, 'query' => 'HTML Corrector module was disabled; this functionality has now been added to core.');
return $ret;
}
// Otherwise, find any format with 'HTML' in its name and add the filter at the end.
$result = db_query("SELECT format FROM {filter_formats} WHERE name LIKE '%HTML%'");
$result = db_query("SELECT format, name FROM {filter_formats} WHERE name LIKE '%HTML%'");
while ($format = db_fetch_object($result)) {
$weight = db_result(db_query("SELECT MAX(weight) FROM {filters} WHERE format = %d", $format->format));
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, '%s', %d, %d)", $format->format, 'filter', 3, max(10, $weight + 1));
$ret[] = array('success' => TRUE, 'query' => "HTML corrector filter added to the '". $format->name ."' input format.");
}
return $ret;
......@@ -2355,7 +2356,7 @@ function system_update_6021() {
$ret[] = update_sql("UPDATE {blocks} SET delta = '". $menu_name ."' WHERE module = 'menu' AND delta = '". $mid ."'");
$ret[] = update_sql("UPDATE {blocks_roles} SET delta = '". $menu_name ."' WHERE module = 'menu' AND delta = '". $mid ."'");
}
$ret[] = array('success' => TRUE, 'query' => t('Relocated @num existing items to the new menu system.', array('@num' => $_SESSION['system_update_6021'])));
$ret[] = array('success' => TRUE, 'query' => 'Relocated '. $_SESSION['system_update_6021'] .'existing items to the new menu system.');
$ret[] = update_sql("DROP TABLE {menu}");
unset($_SESSION['system_update_6021'], $_SESSION['system_update_6021_max'], $_SESSION['menu_menu_map'], $_SESSION['menu_item_map'], $_SESSION['menu_bogus_menus']);
// Create the menu overview links - also calls menu_rebuild(). If menu is
......@@ -2512,7 +2513,7 @@ function system_update_6029() {
drupal_set_installed_schema_version('dblog', 0);
module_enable(array('dblog'));
menu_rebuild();
return array();
return array(array('success' => TRUE, 'query' => "'dblog' module enabled."));
}
/**
......@@ -2545,10 +2546,10 @@ function system_update_6030() {
}
/**
* Ensure that installer cannot be run again after updating from Drupal 5.x to 6.x
*/
* Ensure that installer cannot be run again after updating from Drupal 5.x to 6.x
* Actually, this is already done by system_update_6014(), so this is now a no-op.
*/
function system_update_6031() {
variable_set('install_task', 'done');
return array();
}
......
......@@ -159,7 +159,7 @@ function update_do_one($module, $number, &$context) {
drupal_set_installed_schema_version($module, $number);
}
$context['message'] = t('Updating @module module', array('@module' => $module));
$context['message'] = 'Updating '. check_plain($module) .' module';
}
function update_selection_page() {
......
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