if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) {
$requirements['php']['description'] = $t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP));
// Unfortunately, ini_get() may return many different values, and we can't
// be certain which values mean 'on', so we instead check for 'not off'
// since we never want to tell the user that their site is secure
// (register_globals off), when it is in fact on. We can only guarantee
// register_globals is off if the value returned is 'off', '', or 0.
if (!empty($register_globals) && strtolower($register_globals) != 'off') {
$requirements['php_register_globals']['description'] = $t('<em>register_globals</em> is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when <em>register_globals</em> is enabled. The PHP manual has instructions for <a href="http://php.net/configuration.changes">how to change configuration settings</a>.');
if ($memory_limit && parse_size($memory_limit) < parse_size(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)) {
$description = '';
if ($phase == 'install') {
$description = $t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT));
}
elseif ($phase == 'update') {
$description = $t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the update process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT));
}
elseif ($phase == 'runtime') {
$description = $t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT));
}
if (!empty($description)) {
if ($php_ini_path = get_cfg_var('cfg_file_path')) {
$description .= ' '. $t('Increase the memory limit by editing the memory_limit parameter in the file %configuration-file and then restart your web server (or contact your system administrator or hosting provider for assistance).', array('%configuration-file' => $php_ini_path));
}
else {
$description .= ' '. $t('Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.');
}
$requirements['php_memory_limit']['description'] = $description .' '. $t('See the <a href="@url">Drupal requirements</a> for more information.', array('@url' => 'http://drupal.org/requirements'));
$requirements['settings.php']['description'] .= $t('The directory %file is not protected from modifications and poses a security risk. You must change the directory\'s permissions to be non-writable. ', array('%file' => conf_path()));
}
if (!$conf_file) {
$requirements['settings.php']['description'] .= $t('The file %file is not protected from modifications and poses a security risk. You must change the file\'s permissions to be non-writable.', array('%file' => conf_path() .'/settings.php'));
$help = $t('For more information, see the online handbook entry for <a href="@cron-handbook">configuring cron jobs</a>.', array('@cron-handbook' => 'http://drupal.org/cron'));
// Determine when cron last ran. If never, use the install time to
// determine the warning or error status.
$cron_last = variable_get('cron_last', NULL);
$never_run = FALSE;
if (!is_numeric($cron_last)) {
$never_run = TRUE;
$cron_last = variable_get('install_time', 0);
}
// Determine severity based on time since cron last ran.
$severity = REQUIREMENT_OK;
if (time() - $cron_last > $threshold_error) {
$severity = REQUIREMENT_ERROR;
}
else if ($never_run || (time() - $cron_last > $threshold_warning)) {
$severity = REQUIREMENT_WARNING;
}
// If cron hasn't been run, and the user is viewing the main
// administration page, instead of an error, we display a helpful reminder
// to configure cron jobs.
if ($never_run && $severity != REQUIREMENT_ERROR && $_GET['q'] == 'admin' && user_access('administer site configuration')) {
drupal_set_message($t('Cron has not run. Please visit the <a href="@status">status report</a> for more information.', array('@status' => url('admin/reports/status'))));
}
// Set summary and description based on values determined above.
if ($never_run) {
$summary = $t('Never run');
$description = $t('Cron has not run.') .' '. $help;
$error = $t('The directory %directory does not exist.', array('%directory' => $directory));
}
else {
$error = $t('The directory %directory is not writable.', array('%directory' => $directory));
}
// The files directory requirement check is done only during install and runtime.
if ($phase == 'runtime') {
$description = $error .' '. $t('You may need to set the correct directory at the <a href="@admin-file-system">file system settings page</a> or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/settings/file-system')));
}
elseif ($phase == 'install') {
// For the installer UI, we need different wording. 'value' will
// be treated as version, so provide none there.
$description = $error .' '. $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually, or ensure that the installer has the permissions to create it automatically. For more information, please see INSTALL.txt or the <a href="@handbook_url">on-line handbook</a>.', array('@handbook_url' => 'http://drupal.org/server-permissions'));
$requirements['update']['value'] = $t('Out of date');
$requirements['update']['description'] = $t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() .'update.php'));
break;
}
}
}
}
// Verify the update.php access setting
if ($phase == 'runtime') {
if (!empty($GLOBALS['update_free_access'])) {
$requirements['update access'] = array(
'value' => $t('Not protected'),
'severity' => REQUIREMENT_ERROR,
'description' => $t('The update.php script is accessible to everyone without authentication check, which is a security risk. You must change the $update_free_access value in your settings.php back to FALSE.'),
);
}
else {
$requirements['update access'] = array(
'value' => $t('Protected'),
);
}
$requirements['update access']['title'] = $t('Access to update.php');
'description' => $t('Update notifications are not enabled. It is <strong>highly recommended</strong> that you enable the update status module from the <a href="@module">module administration page</a> in order to stay up-to-date on new releases. For more information please read the <a href="@update">Update status handbook page</a>.', array('@update' => 'http://drupal.org/handbook/modules/update', '@module' => url('admin/build/modules'))),
);
}
else {
$requirements['update status'] = array(
'value' => $t('Enabled'),
);
if (variable_get('drupal_http_request_fails', FALSE)) {
$requirements['http requests'] = array(
'title' => $t('HTTP request status'),
'value' => $t('Fails'),
'severity' => REQUIREMENT_ERROR,
'description' => $t('Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services.'),
db_query("INSERT INTO {variable} (name, value) VALUES ('%s','%s')", 'filter_html_1', 'i:1;');
db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'node_options_forum', 'a:1:{i:0;s:6:"status";}');
}
/**
* Implementation of hook_schema().
*/
function system_schema() {
// NOTE: {variable} needs to be created before all other tables, as
// some database drivers, e.g. Oracle and DB2, will require variable_get()
// and variable_set() for overcoming some database specific limitations.
$schema['variable'] = array(
'description' => t('Named variable/value pairs created by Drupal core or any other module or theme. All variables are cached in memory at the start of every Drupal request so developers should not be careless about what is stored here.'),
'description' => t("A string token generated against the current user's session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it."),
'type' => 'varchar',
'length' => 64,
'not null' => TRUE),
'timestamp' => array(
'description' => t('A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.'),
'type' => 'int',
'not null' => TRUE),
'batch' => array(
'description' => t('A serialized array containing the processing data for the batch.'),
'type' => 'text',
'not null' => FALSE,
'size' => 'big')
),
'primary key' => array('bid'),
'indexes' => array('token' => array('token')),
);
$schema['cache'] = array(
'description' => t('Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.'),
'description' => t('A collection of data to cache.'),
'type' => 'blob',
'not null' => FALSE,
'size' => 'big'),
'expire' => array(
'description' => t('A Unix timestamp indicating when the cache entry should expire, or 0 for never.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'created' => array(
'description' => t('A Unix timestamp indicating when the cache entry was created.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'headers' => array(
'description' => t('Any custom HTTP headers to be added to cached data.'),
'type' => 'text',
'not null' => FALSE),
'serialized' => array(
'description' => t('A flag to indicate whether content is serialized (1) or not (0).'),
'type' => 'int',
'size' => 'small',
'not null' => TRUE,
'default' => 0)
),
'indexes' => array('expire' => array('expire')),
'primary key' => array('cid'),
);
$schema['cache_form'] = $schema['cache'];
$schema['cache_form']['description'] = t('Cache table for the form system to store recently built forms and their storage data, to be used in subsequent page requests.');
$schema['cache_page'] = $schema['cache'];
$schema['cache_page']['description'] = t('Cache table used to store compressed pages for anonymous users, if page caching is enabled.');
$schema['cache_menu'] = $schema['cache'];
$schema['cache_menu']['description'] = t('Cache table for the menu system to store router information as well as generated link trees for various menu/page/user combinations.');
$schema['files'] = array(
'description' => t('Stores information for uploaded files.'),
'description' => t('A record of which {users} have read which {node}s.'),
'fields' => array(
'uid' => array(
'description' => t('The {users}.uid that read the {node} nid.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'nid' => array(
'description' => t('The {node}.nid that was read.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'timestamp' => array(
'description' => t('The Unix timestamp at which the read occurred.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0)
),
'primary key' => array('uid', 'nid'),
'indexes' => array(
'nid' => array('nid'),
),
);
$schema['menu_router'] = array(
'description' => t('Maps paths to various callbacks (access, page and title)'),
'fields' => array(
'path' => array(
'description' => t('Primary Key: the Drupal path this entry describes'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'load_functions' => array(
'description' => t('A serialized array of function names (like node_load) to be called to load an object corresponding to a part of the current path.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'to_arg_functions' => array(
'description' => t('A serialized array of function names (like user_current_to_arg) to be called to replace a part of the router path with another string.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'access_callback' => array(
'description' => t('The callback which determines the access to this router path. Defaults to user_access.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'access_arguments' => array(
'description' => t('A serialized array of arguments for the access callback.'),
'type' => 'text',
'not null' => FALSE),
'page_callback' => array(
'description' => t('The name of the function that renders the page.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'page_arguments' => array(
'description' => t('A serialized array of arguments for the page callback.'),
'type' => 'text',
'not null' => FALSE),
'fit' => array(
'description' => t('A numeric representation of how specific the path is.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'number_parts' => array(
'description' => t('Number of parts in this router path.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'small'),
'tab_parent' => array(
'description' => t('Only for local tasks (tabs) - the router path of the parent page (which may also be a local task).'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'tab_root' => array(
'description' => t('Router path of the closest non-tab parent page. For pages that are not local tasks, this will be the same as the path.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'title' => array(
'description' => t('The title for the current page, or the title for the tab if this is a local task.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'title_callback' => array(
'description' => t('A function which will alter the title. Defaults to t()'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'title_arguments' => array(
'description' => t('A serialized array of arguments for the title callback. If empty, the title will be used as the sole argument for the title callback.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'type' => array(
'description' => t('Numeric representation of the type of the menu item, like MENU_LOCAL_TASK.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'block_callback' => array(
'description' => t('Name of a function used to render the block on the system administration page for this item.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'description' => array(
'description' => t('A description of this item.'),
'type' => 'text',
'not null' => TRUE),
'position' => array(
'description' => t('The position of the block (left or right) on the system administration page for this item.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'weight' => array(
'description' => t('Weight of the element. Lighter weights are higher up, heavier weights go down.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'file' => array(
'description' => t('The file to include for this element, usually the page callback function lives in this file.'),
'type' => 'text',
'size' => 'medium')
),
'indexes' => array(
'fit' => array('fit'),
'tab_parent' => array('tab_parent')
),
'primary key' => array('path'),
);
$schema['menu_links'] = array(
'description' => t('Contains the individual links within a menu.'),
'fields' => array(
'menu_name' => array(
'description' => t("The menu name. All links with the same menu name (such as 'navigation') are part of the same menu."),
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => ''),
'mlid' => array(
'description' => t('The menu link ID (mlid) is the integer primary key.'),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE),
'plid' => array(
'description' => t('The parent link ID (plid) is the mlid of the link above in the hierarchy, or zero if the link is at the top level in its menu.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'link_path' => array(
'description' => t('The Drupal path or external path this link points to.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'router_path' => array(
'description' => t('For links corresponding to a Drupal path (external = 0), this connects the link to a {menu_router}.path for joins.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'link_title' => array(
'description' => t('The text displayed for the link, which may be modified by a title callback stored in {menu_router}.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'options' => array(
'description' => t('A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.'),
'type' => 'text',
'not null' => FALSE),
'module' => array(
'description' => t('The name of the module that generated this link.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => 'system'),
'hidden' => array(
'description' => t('A flag for whether the link should be rendered in menus. (1 = a disabled menu item that may be shown on admin screens, -1 = a menu callback, 0 = a normal, visible link)'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'small'),
'external' => array(
'description' => t('A flag to indicate if the link points to a full URL starting with a protocol, like http:// (1 = external, 0 = internal).'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'small'),
'has_children' => array(
'description' => t('Flag indicating whether any links have this link as a parent (1 = children exist, 0 = no children).'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'small'),
'expanded' => array(
'description' => t('Flag for whether this link should be rendered as expanded in menus - expanded links always have their child links displayed, instead of only when the link is in the active trail (1 = expanded, 0 = not expanded)'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'small'),
'weight' => array(
'description' => t('Link weight among links in the same menu at the same depth.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'depth' => array(
'description' => t('The depth relative to the top level. A link with plid == 0 will have depth == 1.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'small'),
'customized' => array(
'description' => t('A flag to indicate that the user has manually created or edited the link (1 = customized, 0 = not customized).'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'small'),
'p1' => array(
'description' => t('The first mlid in the materialized path. If N = depth, then pN must equal the mlid. If depth > 1 then p(N-1) must equal the plid. All pX where X > depth must equal zero. The columns p1 .. p9 are also called the parents.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'p2' => array(
'description' => t('The second mlid in the materialized path. See p1.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'p3' => array(
'description' => t('The third mlid in the materialized path. See p1.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'p4' => array(
'description' => t('The fourth mlid in the materialized path. See p1.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'p5' => array(
'description' => t('The fifth mlid in the materialized path. See p1.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'p6' => array(
'description' => t('The sixth mlid in the materialized path. See p1.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'p7' => array(
'description' => t('The seventh mlid in the materialized path. See p1.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'p8' => array(
'description' => t('The eighth mlid in the materialized path. See p1.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'p9' => array(
'description' => t('The ninth mlid in the materialized path. See p1.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'updated' => array(
'description' => t('Flag that indicates that this link was generated during the update from Drupal 5.'),
'description' => t("Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated."),
'fields' => array(
'uid' => array(
'description' => t('The {users}.uid corresponding to a session, or 0 for anonymous user.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE),
'sid' => array(
'description' => t("Primary key: A session ID. The value is generated by PHP's Session API."),
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => ''),
'hostname' => array(
'description' => t('The IP address that last used this session ID (sid).'),
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => ''),
'timestamp' => array(
'description' => t('The Unix timestamp when this session last requested a page. Old records are purged by PHP automatically.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'cache' => array(
'description' => t("The time of this user's last post. This is used when the site has specified a minimum_cache_lifetime. See cache_get()."),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'session' => array(
'description' => t('The serialized contents of $_SESSION, an array of name/value pairs that persists across page requests by this session ID. Drupal loads $_SESSION from here at the start of each request and saves it at the end.'),
'type' => 'text',
'not null' => FALSE,
'size' => 'big')
),
'primary key' => array('sid'),
'indexes' => array(
'timestamp' => array('timestamp'),
'uid' => array('uid')
),
);
$schema['system'] = array(
'description' => t("A list of all modules, themes, and theme engines that are or have been installed in Drupal's file system."),
'fields' => array(
'filename' => array(
'description' => t('The path of the primary file for this item, relative to the Drupal root; e.g. modules/node/node.module.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'name' => array(
'description' => t('The name of the item; e.g. node.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'type' => array(
'description' => t('The type of the item, either module, theme, or theme_engine.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'owner' => array(
'description' => t("A theme's 'parent'. Can be either a theme or an engine."),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'status' => array(
'description' => t('Boolean indicating whether or not this item is enabled.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'throttle' => array(
'description' => t('Boolean indicating whether this item is disabled when the throttle.module disables throttleable items.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny'),
'bootstrap' => array(
'description' => t("Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted)."),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'schema_version' => array(
'description' => t("The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed."),
'type' => 'int',
'not null' => TRUE,
'default' => -1,
'size' => 'small'),
'weight' => array(
'description' => t("The order in which this module's hooks should be invoked relative to other modules. Equal-weighted modules are ordered by name."),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'info' => array(
'description' => t("A serialized array containing information from the module's .info file; keys can include name, description, package, version, core, dependencies, dependents, and php."),
'description' => t('A list of URL aliases for Drupal paths; a user may visit either the source or destination path.'),
'fields' => array(
'pid' => array(
'description' => t('A unique path alias identifier.'),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE),
'src' => array(
'description' => t('The Drupal path this alias is for; e.g. node/12.'),
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => ''),
'dst' => array(
'description' => t('The alias for this path; e.g. title-of-the-story.'),
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => ''),
'language' => array(
'description' => t('The language this alias is for; if blank, the alias will be used for unknown languages. Each Drupal path can have an alias for each supported language.'),
drupal_set_message('Saving an old value of the welcome message body for users that are pending administrator approval. However, you should consider modifying this text, since Drupal can now be configured to automatically notify users and send them their login information when their accounts are approved. See the <a href="'. url('admin/user/settings') .'">User settings</a> page for details.');
}
}
}
}
return $ret;
}
/**
* Add HTML corrector to HTML formats or replace the old module if it was in use.
*/
function system_update_6018() {
$ret = array();
// Disable htmlcorrector.module, if it exists and replace its filter.
if (module_exists('htmlcorrector')) {
module_disable(array('htmlcorrector'));
$ret[] = update_sql("UPDATE {filter_formats} SET module = 'filter', delta = 3 WHERE module = 'htmlcorrector'");
$ret[] = array('success' => TRUE, 'query' => 'HTML Corrector module was disabled; this functionality has now been added to core.');
return $ret;
}
// Otherwise, find any format with 'HTML' in its name and add the filter at the end.
$result = db_query("SELECT format, name FROM {filter_formats} WHERE name LIKE '%HTML%'");
while ($format = db_fetch_object($result)) {
$weight = db_result(db_query("SELECT MAX(weight) FROM {filters} WHERE format = %d", $format->format));
* Migrate the menu items from the old menu system to the new menu_links table.
*/
function system_update_6021() {
$ret = array('#finished' => 0);
$menus = array(
'navigation' => array(
'menu_name' => 'navigation',
'title' => 'Navigation',
'description' => 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.',
),
'primary-links' => array(
'menu_name' => 'primary-links',
'title' => 'Primary links',
'description' => 'Primary links are often used at the theme layer to show the major sections of a site. A typical representation for primary links would be tabs along the top.',
),
'secondary-links' => array(
'menu_name' => 'secondary-links',
'title' => 'Secondary links',
'description' => 'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links',
drupal_set_message('Drupal can check periodically for important bug fixes and security releases using the new update status module. This module can be turned on from the <a href="'. url('admin/build/modules') .'">modules administration page</a>. For more information please read the <a href="http://drupal.org/handbook/modules/update">Update status handbook page</a>.');
$ret[] = update_sql("UPDATE {search_dataset} SET reindex = 1");
}
else {
// Delete the existing tables if there are duplicate values
if (db_result(db_query("SELECT sid FROM {search_dataset} GROUP BY sid, type HAVING COUNT(*) > 1")) || db_result(db_query("SELECT sid FROM {search_index} GROUP BY word, sid, type HAVING COUNT(*) > 1"))) {
$ret[] = update_sql('DELETE FROM {search_dataset}');
$ret[] = update_sql('DELETE FROM {search_index}');
$ret[] = update_sql('DELETE FROM {search_total}');
}
else {
// Everything needs to be reindexed.
$ret[] = update_sql("UPDATE {search_dataset} SET reindex = 1");
$ret[] = update_sql("UPDATE {blocks} SET region = '' WHERE status = 0");
return $ret;
}
/**
* Ensure that "Account" is not used as a Profile category.
*/
function system_update_6038() {
$ret = array();
if (db_table_exists('profile_fields')) {
$ret[] = update_sql("UPDATE {profile_fields} SET category = 'Account settings' WHERE LOWER(category) = 'account'");
if ($affectedrows = db_affected_rows()) {
drupal_set_message('There were '. $affectedrows .' profile fields that used a reserved category name. They have been assigned to the category "Account settings".');
}
}
return $ret;
}
/**
* Rename permissions "edit foo content" to "edit any foo content".
* Also update poll module permission "create polls" to "create
* poll content".
*/
function system_update_6039() {
$ret = array();
$result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
$ret[] = update_sql("UPDATE {permission} SET perm = '$renamed_permission' WHERE rid = $role->rid");
}
}
// Notify user that delete permissions may have been changed. This was in
// effect since system_update_6039(), but there was no user notice.
drupal_set_message('Drupal now has separate edit and delete permissions. Previously, users who were able to edit content were automatically allowed to delete it. For added security, delete permissions for individual core content types have been <strong>removed</strong> from all roles on your site (only roles with the "administer nodes" permission can now delete these types of content). If you would like to reenable any individual delete permissions, you can do this at the <a href="'. url('admin/user/permissions', array('fragment' => 'module-node')) .'">permissions page</a>.');
return $ret;
}
/**
* Ensure that the file_directory_path variable is set (using the old 5.x
* default, if necessary), so that the changed 6.x default won't break
* existing sites.
*/
function system_update_6046() {
$ret = array();
if (!variable_get('file_directory_path', FALSE)) {