=== modified file 'includes/session.inc' --- includes/session.inc 2009-11-04 06:00:03 +0000 +++ includes/session.inc 2009-11-06 15:30:01 +0000 @@ -242,6 +242,11 @@ function drupal_session_commit() { return; } + // Expire the keep if possible. + if (isset($_SESSION['drupal_keep']) && ($_SESSION['drupal_keep'] > REQUEST_TIME)) { + unset($_SESSION['drupal_keep']); + } + if (empty($user->uid) && empty($_SESSION)) { // There is no session data to store, destroy the session if it was // previously started. @@ -271,6 +276,25 @@ function drupal_session_started($set = N return $session_started && session_id(); } + /** + * Keep the current user's session open for a given length of time. + * + * @param $duration The length the session needs to remain open, in seconds. + */ +function drupal_session_keep($duration) { + $new_timestamp = REQUEST_TIME + $duration; + if (!isset($_SESSION['drupal_keep']) || ($new_timestamp > $_SESSION['drupal_keep'])) { + $_SESSION['drupal_keep'] = $new_timestamp; + } +} + +/** + * Stop keeping the current user's session open. + */ +function drupal_session_keep_reset() { + unset($_SESSION['drupal_keep']); +} + /** * Called when an anonymous user becomes authenticated or vice-versa. * === modified file 'includes/update.inc' --- includes/update.inc 2009-10-25 00:00:03 +0000 +++ includes/update.inc 2009-11-06 21:52:52 +0000 @@ -126,6 +126,7 @@ function update_fix_d7_requirements() { // Add the cache_path table. $schema['cache_path'] = drupal_get_schema_unprocessed('system', 'cache'); $schema['cache_path']['description'] = 'Cache table used for path alias lookups.'; + db_create_table('cache_path', $schema['cache_path']); // system_update_7042() renames columns, but these are needed to bootstrap. // Add empty columns for now. @@ -196,6 +197,46 @@ function update_fix_d7_requirements() { ); db_create_table('semaphore', $schema['semaphore']); + // Add registry tables since these are required during an update. + // @todo system_update_7006() becomes obsolete + $schema['registry'] = array( + 'fields' => array( + 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'type' => array('type' => 'varchar', 'length' => 9, 'not null' => TRUE, 'default' => ''), + 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + ), + 'primary key' => array('name', 'type'), + 'indexes' => array( + 'hook' => array('type', 'weight', 'module'), + ), + ); + $schema['registry_file'] = array( + 'fields' => array( + 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), + 'filectime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'filemtime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + ), + 'primary key' => array('filename'), + ); + $schema['cache_registry'] = array( + 'fields' => array( + 'cid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'data' => array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'), + 'expire' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'headers' => array('type' => 'text', 'not null' => FALSE), + 'serialized' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0) + ), + 'indexes' => array('expire' => array('expire')), + 'primary key' => array('cid'), + ); + db_create_table('cache_registry', $schema['cache_registry']); + db_create_table('registry', $schema['registry']); + db_create_table('registry_file', $schema['registry_file']); +// registry_rebuild(); + $schema['date_format_type'] = array( 'description' => 'Stores configured date format types.', 'fields' => array( === modified file 'modules/block/block.install' --- modules/block/block.install 2009-10-16 20:00:03 +0000 +++ modules/block/block.install 2009-11-06 16:43:46 +0000 @@ -207,7 +207,6 @@ function block_schema() { * Implement hook_install(). */ function block_install() { - // Block should go first so that other modules can alter its output // during hook_page_alter(). Almost everything on the page is a block, // so before block module runs, there will not be much to alter. @@ -226,7 +225,7 @@ function block_install() { */ function block_update_7000() { db_update('system') - ->fields(array('weight', '-5')) + ->fields(array('weight' => -5)) ->condition('name', 'block') ->execute(); } === modified file 'modules/comment/comment.install' --- modules/comment/comment.install 2009-10-16 14:00:04 +0000 +++ modules/comment/comment.install 2009-11-06 17:11:52 +0000 @@ -73,7 +73,7 @@ function comment_update_7001() { foreach ($changes as $old => $new) { db_update('comments') - ->fields(array('status', $new)) + ->fields(array('status' => $new)) ->condition('status', $old) ->execute(); } @@ -117,7 +117,7 @@ function comment_update_7004() { */ function comment_update_7005() { foreach (node_type_get_types() as $info) { - field_attach_create_bundle('comment', 'comment_node_' . $info->type); +// field_attach_create_bundle('comment', 'comment_node_' . $info->type); } } === modified file 'modules/filter/filter.install' --- modules/filter/filter.install 2009-10-16 20:00:03 +0000 +++ modules/filter/filter.install 2009-11-06 17:13:01 +0000 @@ -191,7 +191,7 @@ function filter_update_7003() { foreach ($renamed_deltas as $module => $deltas) { foreach ($deltas as $old_delta => $new_delta) { db_update('filter') - ->fields(array('name', $new_delta)) + ->fields(array('name' => $new_delta)) ->condition('module', $module) ->condition('name', $old_delta) ->execute(); @@ -230,7 +230,7 @@ function filter_update_7004() { // Enable all existing filters ({filter} contained only enabled previously). db_update('filter') - ->fields('status', '1') + ->fields(array('status' => '1')) ->execute(); // Move filter settings from system variables into {filter}.settings. === modified file 'modules/node/node.install' --- modules/node/node.install 2009-10-16 20:00:03 +0000 +++ modules/node/node.install 2009-11-06 21:29:48 +0000 @@ -369,6 +369,9 @@ function node_update_7000() { ->fields(array('module' => 'node_content')) ->condition('module', 'node') ->execute(); + + // Rename the module column to base. + db_change_field('node_type', 'module', 'base', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE)); } /** @@ -507,7 +510,8 @@ function node_update_7006(&$context) { $node->body[FIELD_LANGUAGE_NONE][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1); // This is a core update and no contrib modules are enabled yet, so // we can assume default field storage for a faster update. - field_sql_storage_field_storage_write('node', $node, FIELD_STORAGE_INSERT, array()); + // @todo the last paramter $fields was missing. must be an array of fields IDs. + field_sql_storage_field_storage_write('node', $node, FIELD_STORAGE_INSERT, array(1, 2)); } // Migrate the status columns to the {node_revision} table. === modified file 'modules/system/system.install' --- modules/system/system.install 2009-10-25 00:00:03 +0000 +++ modules/system/system.install 2009-11-06 19:16:12 +0000 @@ -1933,8 +1933,8 @@ function system_update_7004(&$sandbox) { * Remove throttle columns and variables. */ function system_update_7005() { - db_drop_field('blocks', 'throttle'); - db_drop_field('system', 'throttle'); +// db_drop_field('blocks', 'throttle'); +// db_drop_field('system', 'throttle'); variable_del('throttle_user'); variable_del('throttle_anonymous'); variable_del('throttle_level'); @@ -2518,7 +2518,8 @@ function system_update_7030() { * Add a missing index on the {menu_router} table. */ function system_update_7031() { - db_add_index('menu_router', 'tab_root_weight_title', array(array('tab_root', 64), 'weight', 'title')); +// @todo remove. duplicate key name. +// db_add_index('menu_router', 'tab_root_weight_title', array(array('tab_root', 64), 'weight', 'title')); } /** === modified file 'modules/upload/upload.install' --- modules/upload/upload.install 2009-10-16 20:00:03 +0000 +++ modules/upload/upload.install 2009-11-06 22:11:48 +0000 @@ -98,7 +98,7 @@ function upload_update_7000(&$sandbox) { // As a batch operation move records from {files} into the {file} table. $limit = 500; - $result = db_query_range("SELECT DISTINCT u.fid FROM {upload} u ORDER BY u.vid", array(), 0, $limit); + $result = db_query_range("SELECT DISTINCT u.fid FROM {upload} u ORDER BY u.vid", 0, $limit, array()); foreach ($result as $record) { $old_file = db_query('SELECT f.* FROM {files} f WHERE f.fid = :fid', array(':fid' => $record->fid))->fetch(PDO::FETCH_OBJ); if (!$old_file) { === modified file 'modules/user/user.install' --- modules/user/user.install 2009-10-18 07:00:06 +0000 +++ modules/user/user.install 2009-11-06 18:11:35 +0000 @@ -360,7 +360,7 @@ function user_update_7002(&$sandbox) { else { $sandbox['user_not_migrated']++; db_update('users') - ->fields(array('timezone', NULL)) + ->fields(array('timezone' => NULL)) ->condition('uid', $account->uid) ->execute(); } @@ -427,13 +427,13 @@ function user_update_7004(&$sandbox) { // Initialize batch update information. $sandbox['progress'] = 0; $sandbox['last_user_processed'] = -1; - $sandbox['max'] = db_query("SELECT COUNT(*) FROM {user} WHERE picture <> ''")->fetchField(); + $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE picture <> ''")->fetchField(); } // As a batch operation move the photos into the {file} table and update the // {users} records. $limit = 500; - $result = db_query_range("SELECT uid, picture FROM {user} WHERE picture <> '' AND uid > :uid ORDER BY uid", 0, $limit, array(':uid' => $sandbox['last_user_processed'])); + $result = db_query_range("SELECT uid, picture FROM {users} WHERE picture <> '' AND uid > :uid ORDER BY uid", 0, $limit, array(':uid' => $sandbox['last_user_processed'])); foreach ($result as $user) { // Don't bother adding files that don't exist. if (!file_exists($user->picture)) { @@ -473,8 +473,8 @@ function user_update_7004(&$sandbox) { // When we're finished, drop the old picture field and rename the new one to // replace it. if (isset($sandbox['#finished']) && $sandbox['#finished'] == 1) { - db_drop_field('user', 'picture'); - db_change_field('user', 'picture_fid', 'picture', $picture_field); + db_drop_field('users', 'picture'); + db_change_field('users', 'picture_fid', 'picture', $picture_field); } } === modified file 'update.php' --- update.php 2009-11-04 06:00:03 +0000 +++ update.php 2009-11-06 15:28:34 +0000 @@ -396,6 +396,9 @@ else { if (isset($output) && $output) { // Explictly start a session so that the update.php token will be accepted. drupal_session_start(); + // Force the session to stay open for 15 minutes. + drupal_session_keep(300); + // We defer the display of messages until all updates are done. $progress_page = ($batch = batch_get()) && isset($batch['running']); print theme('update_page', array('content' => $output, 'show_messages' => !$progress_page));