diff options
Diffstat (limited to 'modules/system/system.install')
-rw-r--r-- | modules/system/system.install | 202 |
1 files changed, 5 insertions, 197 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index 5d1f63bf6..162c6b90d 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1882,15 +1882,7 @@ function system_update_7011() { $insert->execute(); } -/** - * Rename {blocks} table to {block}, {blocks_roles} to {block_role} and - * {boxes} to {box}. - */ -function system_update_7012() { - db_rename_table('blocks', 'block'); - db_rename_table('blocks_roles', 'block_role'); - db_rename_table('boxes', 'box'); -} +// system_update_7012() moved to block_update_7002(). /** * Convert default time zone offset to default time zone name. @@ -2028,175 +2020,9 @@ function system_update_7020() { } /** - * Add new blocks to new regions, migrate custom variables to blocks. - */ -function system_update_7021() { - // Collect a list of themes with blocks. - $themes_with_blocks = array(); - $result = db_query("SELECT s.name FROM {system} s INNER JOIN {block} b ON s.name = b.theme WHERE s.type = 'theme' GROUP by s.name"); - - $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); - foreach ($result as $theme) { - $themes_with_blocks[] = $theme->name; - // Add new system generated help block. - $insert->values(array( - 'module' => 'system', - 'delta' => 'help', - 'theme' => $theme->name, - 'status' => 1, - 'weight' => 0, - 'region' => 'help', - 'pages' => '', - 'cache' => 1, - )); - // Add new system generated main page content block. - $insert->values(array( - 'module' => 'system', - 'delta' => 'main', - 'theme' => $theme->name, - 'status' => 1, - 'weight' => 0, - 'region' => 'content', - 'pages' => '', - 'cache' => -1, - )); - } - $insert->execute(); - - // Migrate blocks from left/right regions to first/second regions. - db_update('block') - ->fields(array('region' => 'sidebar_first')) - ->condition('region', 'left') - ->execute(); - db_update('block') - ->fields(array('region' => 'sidebar_second')) - ->condition('region', 'right') - ->execute(); - - // Migrate contact form information. - $default_format = variable_get('filter_default_format', 1); - if ($contact_help = variable_get('contact_form_information', '')) { - $bid = db_insert('box') - ->fields(array( - 'body' => $contact_help, - 'info' => 'Contact page help', - 'format' => $default_format, - )) - ->execute(); - - $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache')); - foreach ($themes_with_blocks as $theme) { - // Add contact help block for themes, which had blocks. - $insert->values(array( - 'module' => 'block', - 'delta' => $bid, - 'theme' => $theme, - 'status' => 1, - 'weight' => 5, - 'region' => 'help', - 'visibility' => 1, - 'pages' => 'contact', - 'cache' => -1, - )); - } - drupal_set_message('The contact form information setting was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the site-wide contact page. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right.'); - } - $insert->execute(); - - // Migrate user help setting. - if ($user_help = variable_get('user_registration_help', '')) { - $bid = db_insert('box')->fields(array('body' => $user_help, 'info' => 'User registration guidelines', 'format' => $default_format))->execute(); - - $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache')); - foreach ($themes_with_blocks as $theme) { - // Add user registration help block for themes, which had blocks. - $insert->values(array( - 'module' => 'block', - 'delta' => $bid, - 'theme' => $theme, - 'status' => 1, - 'weight' => 5, - 'region' => 'help', - 'visibility' => 1, - 'pages' => 'user/register', - 'cache' => -1, - )); - } - drupal_set_message('The user registration guidelines were migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the user registration page. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right.'); - $insert->execute(); - } - - // Migrate site mission setting. - if ($mission = variable_get('site_mission')) { - $bid = db_insert('box')->fields(array('body' => $mission, 'info' => 'Site mission', 'format' => $default_format))->execute(); - - $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'cache')); - foreach ($themes_with_blocks as $theme) { - // Add mission block for themes, which had blocks. - $insert->values(array( - 'module' => 'block', - 'delta' => $bid, - 'theme' => $theme, - 'status' => 1, - 'weight' => 0, - 'region' => 'highlight', - 'visibility' => 1, - 'pages' => '<front>', - 'cache' => -1, - )); - } - drupal_set_message('The site mission was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the front page in the highlighted content region. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right. If your theme does not have a highlighted content region, you might need to <a href="' . url('admin/structure/block') . '">relocate the block</a>.'); - $insert->execute(); - // Migrate mission to RSS site description. - variable_set('feed_description', $mission); - } - - // Migrate site footer message to a custom block. - if ($footer_message = variable_get('site_footer', '')) { - $bid = db_insert('box')->fields(array('body' => $footer_message, 'info' => 'Footer message', 'format' => $default_format))->execute(); - - $insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); - foreach ($themes_with_blocks as $theme) { - // Add site footer block for themes, which had blocks. - // Set low weight, so the block comes early (it used to be - // before the other blocks). - $insert->values(array( - 'module' => 'block', - 'delta' => $bid, - 'theme' => $theme, - 'status' => 1, - 'weight' => -10, - 'region' => 'footer', - 'pages' => '', - 'cache' => -1, - )); - } - drupal_set_message('The footer message was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to appear in the footer. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right. If your theme does not have a footer region, you might need to <a href="' . url('admin/structure/block') . '">relocate the block</a>.'); - $insert->execute(); - } - - // Remove the variables (even if they were saved empty on the admin interface), - // to avoid keeping clutter in the variables table. - variable_del('contact_form_information'); - variable_del('user_registration_help'); - variable_del('site_mission'); - variable_del('site_footer'); - - // Rebuild theme data, so the new 'help' region is identified. - system_rebuild_theme_data(); -} - -/** - * Add the queue tables. - */ -function system_update_7022() { - // Moved to update_fix_d7_requirements(). -} - -/** * Change the PHP for settings permission. */ -function system_update_7023() { +function system_update_7021() { db_update('role_permission') ->fields(array('permission' => 'use PHP for settings')) ->condition('permission', 'use PHP for block visibility') @@ -2245,18 +2071,7 @@ function system_update_7027() { module_enable($module_list, FALSE); } -/** - * Rename taxonomy tables. - */ -function system_update_7028() { - db_rename_table('term_data', 'taxonomy_term_data'); - db_rename_table('term_hierarchy', 'taxonomy_term_hierarchy'); - db_rename_table('term_node', 'taxonomy_term_node'); - db_rename_table('term_relation', 'taxonomy_term_relation'); - db_rename_table('term_synonym', 'taxonomy_term_synonym'); - db_rename_table('vocabulary', 'taxonomy_vocabulary'); - db_rename_table('vocabulary_node_types', 'taxonomy_vocabulary_node_type'); -} +// system_update_7028() moved to taxonomy_update_7001(). /** * Add new 'view own unpublished content' permission for authenticated users. @@ -2404,7 +2219,7 @@ function system_update_7035() { // The old {files} tables still exists. We migrate core data from upload // module, but any contrib module using it will need to do its own update. - $result = db_query('SELECT fid, uid, filename, filepath AS uri, filemime, filesize, status, timestamp FROM {files} f INNER JOIN {upload} u ON u.fid = f.fid', array(), array('fetch' => PDO::FETCH_ASSOC)); + $result = db_query('SELECT f.fid, uid, filename, filepath AS uri, filemime, filesize, status, timestamp FROM {files} f INNER JOIN {upload} u ON u.fid = f.fid', array(), array('fetch' => PDO::FETCH_ASSOC)); // We will convert filepaths to uri using the default schmeme // and stripping off the existing file directory path. @@ -2446,16 +2261,9 @@ function system_update_7036() { } /** - * Rename {box} table to {block_custom}. - */ -function system_update_7037() { - db_rename_table('box', 'block_custom'); -} - -/** * Rename action description to label. */ -function system_update_7038() { +function system_update_7037() { db_change_field('actions', 'description', 'label', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0')); } |