From 02539ac3f830101345cf5c715b0001aa1eb5a9c0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 18 Dec 2007 10:31:42 +0000 Subject: [PATCH] - Patch #195496 by bjaspan and hunmonk: no 'char' data type in Schema API (and removed spaces). --- includes/common.inc | 8 ++++---- includes/database.inc | 1 + includes/database.mysql-common.inc | 1 + includes/database.pgsql.inc | 1 + includes/install.inc | 2 +- modules/color/color.module | 8 ++++---- modules/forum/forum.install | 4 ++-- modules/forum/forum.module | 2 +- modules/menu/menu.admin.inc | 6 +++--- modules/node/node.pages.inc | 2 +- modules/php/php.module | 2 +- modules/system/system.install | 2 +- 12 files changed, 21 insertions(+), 18 deletions(-) diff --git a/includes/common.inc b/includes/common.inc index 00f497d4e88..8c47f0036f4 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1500,10 +1500,10 @@ function drupal_map_assoc($array, $function = NULL) { */ function drupal_eval($code) { global $theme_path, $theme_info, $conf; - + // Store current theme path. $old_theme_path = $theme_path; - + // Restore theme_path to the theme, as long as drupal_eval() executes, // so code evaluted will not see the caller module as the current theme. // If theme info is not initialized get the path from theme_default. @@ -1518,10 +1518,10 @@ function drupal_eval($code) { print eval('?>'. $code); $output = ob_get_contents(); ob_end_clean(); - + // Recover original theme path. $theme_path = $old_theme_path; - + return $output; } diff --git a/includes/database.inc b/includes/database.inc index 7f42e7419be..0bdb115d7ad 100644 --- a/includes/database.inc +++ b/includes/database.inc @@ -503,6 +503,7 @@ function db_field_names($fields) { function db_type_placeholder($type) { switch ($type) { case 'varchar': + case 'char': case 'text': case 'datetime': return '\'%s\''; diff --git a/includes/database.mysql-common.inc b/includes/database.mysql-common.inc index 0f2c82b43d7..a537e7a59ce 100644 --- a/includes/database.mysql-common.inc +++ b/includes/database.mysql-common.inc @@ -199,6 +199,7 @@ function db_type_map() { // database types back into schema types. $map = array( 'varchar:normal' => 'VARCHAR', + 'char:normal' => 'CHAR', 'text:tiny' => 'SMALLTEXT', 'text:small' => 'SMALLTEXT', diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc index deb81f7da84..b4eb19dcdbc 100644 --- a/includes/database.pgsql.inc +++ b/includes/database.pgsql.inc @@ -461,6 +461,7 @@ function db_type_map() { // database types back into schema types. $map = array( 'varchar:normal' => 'varchar', + 'char:normal' => 'char', 'text:tiny' => 'text', 'text:small' => 'text', diff --git a/includes/install.inc b/includes/install.inc index 6fd8ec64260..f98e56e9d5c 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -63,7 +63,7 @@ function drupal_get_schema_versions($module) { * @param $reset * Set to TRUE after modifying the system table. * @param $array - * Set to TRUE if you want to get information about all modules in the + * Set to TRUE if you want to get information about all modules in the * system. * @return * The currently installed schema version. diff --git a/modules/color/color.module b/modules/color/color.module index 98f670b985b..4cd887dcf8e 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -9,7 +9,7 @@ function color_help($path, $arg) { case 'admin/help#color': $output = '

'. t('The color module allows a site administrator to quickly and easily change the color scheme of certain themes. Although all themes do not support color module, both Garland, the default theme, and Minnelli, its fixed width counterpart, were designed to take advantage of its features. By using color module with a compatible theme, you can easily change the color of links, backgrounds, text, and other theme elements. Color module requires that your file download method be set to public.', array('@url' => url('admin/settings/file-system'))) .'

'; $output .= '

'. t("It is important to remember that color module saves a modified copy of the theme's specified stylesheets in the files directory. This means that if you make any manual changes to your theme's stylesheet, you must save your color settings again, even if they haven't changed. This causes the color module generated version of the stylesheets in the files directory to be recreated using the new version of the original file.") .'

'; - $output .= '

'. t('For more information, see the online handbook entry for Color module.', array('@color' => 'http://drupal.org/handbook/modules/color/')) .'

'; + $output .= '

'. t('For more information, see the online handbook entry for Color module.', array('@color' => 'http://drupal.org/handbook/modules/color/')) .'

'; return $output; } } @@ -334,8 +334,8 @@ function color_scheme_form_submit($form, &$form_state) { } foreach ($files as $file) { - // Aggregate @imports recursively for each configured top level CSS file - // without optimization. Aggregation and optimization will be + // Aggregate @imports recursively for each configured top level CSS file + // without optimization. Aggregation and optimization will be // handled by drupal_build_css_cache() only. $style = drupal_load_stylesheet($paths['source'] . $file, FALSE); @@ -352,7 +352,7 @@ function color_scheme_form_submit($form, &$form_state) { $base_file = basename($file); $css[] = $paths['target'] . $base_file; _color_save_stylesheet($paths['target'] . $base_file, $style, $paths); - } + } } // Maintain list of files. diff --git a/modules/forum/forum.install b/modules/forum/forum.install index a68f1894208..76b66a26702 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -7,8 +7,8 @@ function forum_install() { // Create tables. drupal_install_schema('forum'); - // Set the weight of the forum.module to 1 so it is loaded after the taxonomy.module. - db_query("UPDATE {system} SET weight = 1 WHERE name = 'forum'"); + // Set the weight of the forum.module to 1 so it is loaded after the taxonomy.module. + db_query("UPDATE {system} SET weight = 1 WHERE name = 'forum'"); } function forum_enable() { diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 96fe5f8ef20..92eb1c2e0f2 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -357,7 +357,7 @@ function forum_form_alter(&$form, $form_state, $form_id) { $form['settings']['relations'] = array('#type' => 'value', '#value' => FALSE); $form['settings']['tags'] = array('#type' => 'value', '#value' => FALSE); $form['settings']['multiple'] = array('#type' => 'value', '#value' => FALSE); - unset($form['delete']); + unset($form['delete']); } } // Hide multiple parents select from forum terms. diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc index 021bd4bd007..ca2e9a71a92 100644 --- a/modules/menu/menu.admin.inc +++ b/modules/menu/menu.admin.inc @@ -366,12 +366,12 @@ function menu_item_delete_submit($form, &$form_state) { */ function menu_edit_item_submit($form, &$form_state) { $item = $form_state['values']['menu']; - + // The value of "hidden" is the opposite of the value - // supplied by the "enabled" checkbox. + // supplied by the "enabled" checkbox. $item['hidden'] = (int) !$item['enabled']; unset($item['enabled']); - + $item['options']['attributes']['title'] = $item['description']; list($item['menu_name'], $item['plid']) = explode(':', $item['parent']); if (!menu_link_save($item)) { diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 490bc275ddf..1092240f13a 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -656,7 +656,7 @@ function node_revision_delete_confirm_submit($form, &$form_state) { db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $node_revision->nid, $node_revision->vid); node_invoke_nodeapi($node_revision, 'delete revision'); watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title, '%revision' => $node_revision->vid)); - drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($node_revision->revision_timestamp), '@type' => node_get_types('name', $node_revision), '%title' => $node_revision->title))); + drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($node_revision->revision_timestamp), '@type' => node_get_types('name', $node_revision), '%title' => $node_revision->title))); $form_state['redirect'] = 'node/'. $node_revision->nid; if (db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $node_revision->nid)) > 1) { $form_state['redirect'] .= '/revisions'; diff --git a/modules/php/php.module b/modules/php/php.module index 121db082300..cfd0926ff66 100644 --- a/modules/php/php.module +++ b/modules/php/php.module @@ -16,7 +16,7 @@ function php_help($path, $arg) { $output = '

'. t('The PHP filter adds the ability to include PHP code in posts. PHP is a general-purpose scripting language widely-used for web development; the content management system used by this website has been developed using PHP.') .'

'; $output .= '

'. t('Through the PHP filter, users with the proper permission may include custom PHP code within a page of the site. While this is a powerful and flexible feature if used by a trusted user with PHP experience, it is a significant and dangerous security risk in the hands of a malicious user. Even a trusted user may accidentally compromise the site by entering malformed or incorrect PHP code. Only the most trusted users should be granted permission to use the PHP filter, and all PHP code added through the PHP filter should be carefully examined before use.') .'

'; $output .= '

'. t('Drupal.org offers some example PHP snippets, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) .'

'; - $output .= '

'. t('For more information, see the online handbook entry for PHP module.', array('@php' => 'http://drupal.org/handbook/modules/php/')) .'

'; + $output .= '

'. t('For more information, see the online handbook entry for PHP module.', array('@php' => 'http://drupal.org/handbook/modules/php/')) .'

'; return $output; } } diff --git a/modules/system/system.install b/modules/system/system.install index e133b0ecd43..e7599c41d85 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1043,7 +1043,7 @@ function system_schema() { * @defgroup updates-4.7.x-extra Extra system updates for 4.7.x * @{ */ - + function system_update_last_removed() { return 179; }