Commit 29eb5a62 authored by Dries's avatar Dries

- Patch #146910 by dww: only allow enabling modules with the same Drupal core...

- Patch #146910 by dww: only allow enabling modules with the same Drupal core compatibility version.
parent 54671976
......@@ -8,7 +8,7 @@ Drupal 6.0, xxxx-xx-xx (development version)
* The watchdog module is now called dblog, and is optional, but enabled by default in the default install profile.
* Extended the database log module so log messages can be filtered.
* Added syslog module: useful for monitoring large Drupal installations.
- Added optional e-mail notifications when user are approved, blocked, or deleted.
- Added optional e-mail notifications when users are approved, blocked, or deleted.
- Added versioning support to node terms.
- Made it easier to theme the forum overview page.
- Made Drupal work correctly when running behind a reverse proxy like Squid or Pound.
......@@ -32,6 +32,7 @@ Drupal 6.0, xxxx-xx-xx (development version)
* Removed default/settings.php. Instead the installer will create it from default.settings.php.
* Made it possible to configure your own date formats.
* Remember anonymous comment posters.
* Only allow modules and themes to be enabled that have explicitly been ported to the right core API version.
- Theme system:
* Added .info files to themes and made it easier to specify regions and features.
* Added theme registry: modules can directly provide .tpl.php files for their themes without having to create theme_ functions.
......
......@@ -3,3 +3,4 @@ name = Aggregator
description = "Aggregates syndicated content (RSS, RDF, and Atom feeds)."
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Block
description = Controls the boxes that are displayed around the main content.
package = Core - required
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Blog
description = Enables keeping easily and regularly updated user web pages or blogs.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Blog API
description = Allows users to post content using applications that support XML-RPC blog APIs.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Book
description = Allows users to collaboratively author a book.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Color
description = Allows the user to change the color scheme of certain themes.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Comment
description = Allows users to comment on and discuss published content.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Contact
description = Enables the use of both personal and site-wide contact forms.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Database logging
description = Logs and records system events to the database.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Drupal
description = Lets you register your site with a central server and improve ranking of Drupal projects by posting information on your installed modules and themes; also enables users to log in using a Drupal ID.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Filter
description = Handles the filtering of content in preparation for display.
package = Core - required
version = VERSION
core = 6.x
......@@ -5,3 +5,4 @@ dependencies[] = taxonomy
dependencies[] = comment
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Help
description = Manages the display of online help.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Locale
description = Add language handling functionality and enables the translation of the user interface to languages other than English.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Menu
description = Allows administrators to customize the site navigation menu.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Node
description = Allows content to be submitted to the site and displayed on pages.
package = Core - required
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Path
description = Allows users to rename URLs.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = PHP filter
description = Allows embedded PHP code/snippets to be evaluated.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Ping
description = Alerts other sites when your site has been updated.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Poll
description = Allows your site to capture votes on different topics in the form of multiple choice questions.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Profile
description = Supports configurable user profiles.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Search
description = Enables site-wide keyword searching.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Statistics
description = Logs access statistics for your site.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Syslog
description = Logs and records system events to syslog.
package = Core - optional
version = VERSION
core = 6.x
......@@ -445,3 +445,10 @@ thead div.sticky-header {
html.js .js-hide {
display: none;
}
/*
** Styles for the system modules page (admin/build/modules)
*/
#system-modules div.incompatible {
font-weight: bold;
}
......@@ -3,3 +3,4 @@ name = System
description = Handles general site configuration for administrators.
package = Core - required
version = VERSION
core = 6.x
......@@ -7,6 +7,7 @@
*/
define('VERSION', '6.0-dev');
define('DRUPAL_CORE_COMPATIBILITY', '6.x');
define('DRUPAL_MINIMUM_PHP', '4.3.3');
define('DRUPAL_MINIMUM_MYSQL', '4.1.0'); // If using MySQL
......@@ -1471,12 +1472,20 @@ function system_modules($form_state = array()) {
// Array for disabling checkboxes in callback system_module_disable.
$disabled = array();
$throttle = array();
$incompatible = array();
// Traverse the files retrieved and build the form.
foreach ($files as $filename => $file) {
$form['name'][$filename] = array('#value' => $file->info['name']);
$form['version'][$filename] = array('#value' => $file->info['version']);
$form['description'][$filename] = array('#value' => t($file->info['description']));
$options[$filename] = '';
// Ensure this module is compatible with this version of core.
if (!isset($file->info['core']) || $file->info['core'] != DRUPAL_CORE_COMPATIBILITY) {
$incompatible[] = $file->name;
$disabled[] = $file->name;
// Nothing else in this loop matters, so move to the next module.
continue;
}
if ($file->status) {
$status[] = $file->name;
}
......@@ -1554,6 +1563,7 @@ function system_modules($form_state = array()) {
'system_modules_disable',
),
'#disabled_modules' => $disabled,
'#incompatible_modules' => drupal_map_assoc($incompatible),
);
// Handle throttle checkboxes, including overriding the
......@@ -1797,14 +1807,22 @@ function theme_system_modules($form) {
$rows = array();
foreach ($modules as $key => $module) {
$row = array();
$row[] = array('data' => drupal_render($form['status'][$key]), 'align' => 'center');
$description = drupal_render($form['description'][$key]);
if (isset($form['status']['#incompatible_modules'][$key])) {
unset($form['status'][$key]);
$status = theme('image', 'misc/watchdog-error.png', t('incompatible'), t('Incompatible with this version of Drupal core'));
$description .= '<div class="incompatible">'. t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) .'</div>';
}
else {
$status = drupal_render($form['status'][$key]);
}
$row[] = array('data' => $status, 'align' => 'center');
if (module_exists('throttle')) {
$row[] = array('data' => drupal_render($form['throttle'][$key]), 'align' => 'center');
}
$row[] = '<strong>'. drupal_render($form['name'][$key]) .'</strong>';
$row[] = drupal_render($form['version'][$key]);
$row[] = array('data' => drupal_render($form['description'][$key]), 'class' => 'description');
$row[] = array('data' => $description, 'class' => 'description');
$rows[] = $row;
}
$fieldset = array(
......
......@@ -3,3 +3,4 @@ name = Taxonomy
description = Enables the categorization of content.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Throttle
description = Handles the auto-throttling mechanism, to control site congestion.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Tracker
description = Enables tracking of recent posts for users.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = Upload
description = Allows users to upload and attach files to content.
package = Core - optional
version = VERSION
core = 6.x
......@@ -3,3 +3,4 @@ name = User
description = Manages the user registration and login system.
package = Core - required
version = VERSION
core = 6.x
......@@ -2,4 +2,5 @@
name = Bluemarine
description = Table-based multi-column theme with a marine and ash color scheme.
version = VERSION
core = 6.x
engine = phptemplate
......@@ -8,3 +8,4 @@ features[] = favicon
features[] = name
features[] = slogan
version = VERSION
core = 6.x
......@@ -4,4 +4,5 @@ description = Boxy tabled theme in all grays.
regions[left] = Left sidebar
regions[right] = Right sidebar
version = VERSION
core = 6.x
base theme = chameleon
......@@ -2,4 +2,5 @@
name = Garland
description = Tableless, recolorable, multi-column, fluid width theme (default).
version = VERSION
core = 6.x
engine = phptemplate
......@@ -2,4 +2,5 @@
name = Minnelli
description = Tableless, recolorable, multi-column, fixed width theme.
version = VERSION
core = 6.x
base theme = garland
......@@ -2,4 +2,5 @@
name = Pushbutton
description = Tabled, multi-column theme in blue and orange tones.
version = VERSION
core = 6.x
engine = phptemplate
......@@ -701,6 +701,37 @@ function update_create_batch_table() {
return $ret;
}
/**
* Disable anything in the {system} table that is not compatible with the
* current version of Drupal core.
*/
function update_fix_compatibility() {
$ret = array();
$incompatible = array();
$themes = system_theme_data();
$modules = module_rebuild_cache();
$query = db_query("SELECT name, type, status FROM {system} WHERE status = 1 AND type IN ('module','theme')");
while ($result = db_fetch_object($query)) {
$name = $result->name;
$file = array();
if ($result->type == 'module' && isset($modules[$name])) {
$file = $modules[$name];
}
else if ($result->type == 'theme' && isset($themes[$name])) {
$file = $themes[$name];
}
if (!isset($file)
|| !isset($file->info['core'])
|| $file->info['core'] != DRUPAL_CORE_COMPATIBILITY) {
$incompatible[] = $name;
}
}
if (!empty($incompatible)) {
$ret[] = update_sql("UPDATE {system} SET status = 0 WHERE name IN ('". implode("','", $incompatible) ."')");
}
return $ret;
}
/**
* Add the update task list to the current page.
*/
......@@ -747,6 +778,7 @@ function update_task_list($active = NULL) {
update_fix_watchdog_115();
update_fix_watchdog();
update_fix_sessions();
update_fix_compatibility();
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
switch ($op) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment