Running multiple updates for a module was broken since the installer.
parent
b138793b68
commit
6a13ffefe5
14
update.php
14
update.php
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Enforce access checking?
|
// Enforce access checking?
|
||||||
$access_check = TRUE;
|
$access_check = FALSE;TRUE;
|
||||||
|
|
||||||
|
|
||||||
function update_sql($sql) {
|
function update_sql($sql) {
|
||||||
|
@ -328,6 +328,10 @@ function update_selection_page() {
|
||||||
'#collapsible' => TRUE,
|
'#collapsible' => TRUE,
|
||||||
'#collapsed' => TRUE,
|
'#collapsed' => TRUE,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Ensure system.module's updates appear first
|
||||||
|
$form['start']['system'] = array();
|
||||||
|
|
||||||
foreach (module_list() as $module) {
|
foreach (module_list() as $module) {
|
||||||
$updates = drupal_get_schema_versions($module);
|
$updates = drupal_get_schema_versions($module);
|
||||||
if ($updates !== FALSE) {
|
if ($updates !== FALSE) {
|
||||||
|
@ -363,20 +367,16 @@ function update_selection_page() {
|
||||||
|
|
||||||
function update_update_page() {
|
function update_update_page() {
|
||||||
// Set the installed version so updates start at the correct place.
|
// Set the installed version so updates start at the correct place.
|
||||||
// Ensure system.module's updates are run first by making it the first element.
|
|
||||||
$_SESSION['update_remaining'] = array('system' => '');
|
|
||||||
foreach ($_POST['edit']['start'] as $module => $version) {
|
foreach ($_POST['edit']['start'] as $module => $version) {
|
||||||
drupal_set_installed_schema_version($module, $version - 1);
|
drupal_set_installed_schema_version($module, $version - 1);
|
||||||
$max_version = max(drupal_get_schema_versions($module));
|
$max_version = max(drupal_get_schema_versions($module));
|
||||||
if ($version <= $max_version) {
|
if ($version <= $max_version) {
|
||||||
foreach (range($version, $max_version) as $update) {
|
foreach (range($version, $max_version) as $update) {
|
||||||
$_SESSION['update_remaining'][$module] = array('module' => $module, 'version' => $update);
|
$_SESSION['update_remaining'][] = array('module' => $module, 'version' => $update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$_SESSION['update_remaining']['system']) {
|
|
||||||
unset($_SESSION['update_remaining']['system']);
|
|
||||||
}
|
|
||||||
// Keep track of total number of updates
|
// Keep track of total number of updates
|
||||||
$_SESSION['update_total'] = count($_SESSION['update_remaining']);
|
$_SESSION['update_total'] = count($_SESSION['update_remaining']);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue