#612920 by catch: Added required table columns so that update.php doesn't spew fatal errors.

merge-requests/26/head
Angie Byron 2009-10-24 01:22:28 +00:00
parent a7149821d6
commit cc88a19993
3 changed files with 26 additions and 2 deletions

View File

@ -126,7 +126,11 @@ 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.
db_add_field('url_alias', 'source', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
db_add_field('url_alias', 'alias', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
// Add column for locale context.
if (db_table_exists('locales_source')) {

View File

@ -2832,6 +2832,16 @@ function system_update_7041() {
* Rename dst and src to source and alias.
*/
function system_update_7042() {
// update_fix_d7_requirements() adds 'fake' source and alias columns to
// allow bootstrap to run without fatal errors. Remove those columns now
// so that we can rename properly.
db_drop_field('url_alias', 'source');
db_drop_field('url_alias', 'alias');
// 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']);
// Drop indexes.
db_drop_index('url_alias', 'src_language_pid');
db_drop_unique_key('url_alias', 'dst_language_pid');
@ -2841,6 +2851,7 @@ function system_update_7042() {
// Add indexes back.
db_add_index('url_alias', 'source_language_pid', array('source', 'language', 'pid'));
db_add_unique_key('url_alias', 'alias_language_pid', array('alias', 'language', 'pid'));
}
/**

View File

@ -334,6 +334,16 @@ if (empty($op) && update_access_allowed()) {
install_goto('update.php?op=info');
}
// update_fix_d7_requirements() needs to run before bootstrapping beyond path.
// So bootstrap to DRUPAL_BOOTSTRAP_LANGUAGE then include unicode.inc.
drupal_bootstrap(DRUPAL_BOOTSTRAP_LANGUAGE);
include_once DRUPAL_ROOT . '/includes/unicode.inc';
update_fix_d7_requirements();
// Now proceed with a full bootstrap.
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_maintenance_theme();
@ -348,7 +358,6 @@ if (update_access_allowed()) {
include_once DRUPAL_ROOT . '/includes/batch.inc';
drupal_load_updates();
update_fix_d7_requirements();
update_fix_compatibility();
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';