diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-06-08 05:50:58 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-06-08 05:50:58 +0000 |
commit | 29eb5a62847349897716c316c8e409e5209f8535 (patch) | |
tree | 0c779c444cab8703885cb8ea41b6cae19123f577 | |
parent | 546719769bcd61d7df7cb640effda3fcbf1131d7 (diff) | |
download | brdo-29eb5a62847349897716c316c8e409e5209f8535.tar.gz brdo-29eb5a62847349897716c316c8e409e5209f8535.tar.bz2 |
- Patch #146910 by dww: only allow enabling modules with the same Drupal core compatibility version.
40 files changed, 98 insertions, 4 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 708bbf28e..565ad9e15 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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. diff --git a/modules/aggregator/aggregator.info b/modules/aggregator/aggregator.info index 84c7c0afd..5697ae313 100644 --- a/modules/aggregator/aggregator.info +++ b/modules/aggregator/aggregator.info @@ -3,3 +3,4 @@ name = Aggregator description = "Aggregates syndicated content (RSS, RDF, and Atom feeds)." package = Core - optional version = VERSION +core = 6.x diff --git a/modules/block/block.info b/modules/block/block.info index 8c12ddec7..858e44f62 100644 --- a/modules/block/block.info +++ b/modules/block/block.info @@ -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 diff --git a/modules/blog/blog.info b/modules/blog/blog.info index 898386dd9..3dc887322 100644 --- a/modules/blog/blog.info +++ b/modules/blog/blog.info @@ -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 diff --git a/modules/blogapi/blogapi.info b/modules/blogapi/blogapi.info index ceab75326..d1781117e 100644 --- a/modules/blogapi/blogapi.info +++ b/modules/blogapi/blogapi.info @@ -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 diff --git a/modules/book/book.info b/modules/book/book.info index e9f69bdfb..7dfa8ab4b 100644 --- a/modules/book/book.info +++ b/modules/book/book.info @@ -3,3 +3,4 @@ name = Book description = Allows users to collaboratively author a book. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/color/color.info b/modules/color/color.info index 9c66ccdc3..82d04b2b4 100644 --- a/modules/color/color.info +++ b/modules/color/color.info @@ -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 diff --git a/modules/comment/comment.info b/modules/comment/comment.info index 0fe9f1dd5..5d13a6f57 100644 --- a/modules/comment/comment.info +++ b/modules/comment/comment.info @@ -3,3 +3,4 @@ name = Comment description = Allows users to comment on and discuss published content. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/contact/contact.info b/modules/contact/contact.info index 238275eaf..2a2e742c1 100644 --- a/modules/contact/contact.info +++ b/modules/contact/contact.info @@ -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 diff --git a/modules/dblog/dblog.info b/modules/dblog/dblog.info index 124280577..4072ad4f5 100644 --- a/modules/dblog/dblog.info +++ b/modules/dblog/dblog.info @@ -3,3 +3,4 @@ name = Database logging description = Logs and records system events to the database. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/drupal/drupal.info b/modules/drupal/drupal.info index ce23d5c27..61a8afad7 100644 --- a/modules/drupal/drupal.info +++ b/modules/drupal/drupal.info @@ -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 diff --git a/modules/filter/filter.info b/modules/filter/filter.info index 058a40b9a..1f19f7616 100644 --- a/modules/filter/filter.info +++ b/modules/filter/filter.info @@ -3,3 +3,4 @@ name = Filter description = Handles the filtering of content in preparation for display. package = Core - required version = VERSION +core = 6.x diff --git a/modules/forum/forum.info b/modules/forum/forum.info index eab2e580c..00828a407 100644 --- a/modules/forum/forum.info +++ b/modules/forum/forum.info @@ -5,3 +5,4 @@ dependencies[] = taxonomy dependencies[] = comment package = Core - optional version = VERSION +core = 6.x diff --git a/modules/help/help.info b/modules/help/help.info index da857ef96..ea6dc5507 100644 --- a/modules/help/help.info +++ b/modules/help/help.info @@ -3,3 +3,4 @@ name = Help description = Manages the display of online help. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/locale/locale.info b/modules/locale/locale.info index 88d6ee7bc..24478931d 100644 --- a/modules/locale/locale.info +++ b/modules/locale/locale.info @@ -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 diff --git a/modules/menu/menu.info b/modules/menu/menu.info index 724b48445..56f8d140a 100644 --- a/modules/menu/menu.info +++ b/modules/menu/menu.info @@ -3,3 +3,4 @@ name = Menu description = Allows administrators to customize the site navigation menu. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/node/node.info b/modules/node/node.info index 7bbc00b32..95ddbe39b 100644 --- a/modules/node/node.info +++ b/modules/node/node.info @@ -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 diff --git a/modules/path/path.info b/modules/path/path.info index 71501d850..8ba436f60 100644 --- a/modules/path/path.info +++ b/modules/path/path.info @@ -3,3 +3,4 @@ name = Path description = Allows users to rename URLs. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/php/php.info b/modules/php/php.info index 712f540a1..2327acc73 100644 --- a/modules/php/php.info +++ b/modules/php/php.info @@ -3,3 +3,4 @@ name = PHP filter description = Allows embedded PHP code/snippets to be evaluated. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/ping/ping.info b/modules/ping/ping.info index cf72abb0a..c89de3baa 100644 --- a/modules/ping/ping.info +++ b/modules/ping/ping.info @@ -3,3 +3,4 @@ name = Ping description = Alerts other sites when your site has been updated. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/poll/poll.info b/modules/poll/poll.info index 45d9c16f0..1622d36e6 100644 --- a/modules/poll/poll.info +++ b/modules/poll/poll.info @@ -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 diff --git a/modules/profile/profile.info b/modules/profile/profile.info index 042adc47b..139670c63 100644 --- a/modules/profile/profile.info +++ b/modules/profile/profile.info @@ -3,3 +3,4 @@ name = Profile description = Supports configurable user profiles. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/search/search.info b/modules/search/search.info index 4ebabd18d..1ea0f110d 100644 --- a/modules/search/search.info +++ b/modules/search/search.info @@ -3,3 +3,4 @@ name = Search description = Enables site-wide keyword searching. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/statistics/statistics.info b/modules/statistics/statistics.info index 43ca8f710..8934614ba 100644 --- a/modules/statistics/statistics.info +++ b/modules/statistics/statistics.info @@ -3,3 +3,4 @@ name = Statistics description = Logs access statistics for your site. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/syslog/syslog.info b/modules/syslog/syslog.info index fc76cc873..e08efb52a 100644 --- a/modules/syslog/syslog.info +++ b/modules/syslog/syslog.info @@ -3,3 +3,4 @@ name = Syslog description = Logs and records system events to syslog. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/system/system.css b/modules/system/system.css index ef20fb1fe..67f92d89d 100644 --- a/modules/system/system.css +++ b/modules/system/system.css @@ -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; +} diff --git a/modules/system/system.info b/modules/system/system.info index a894f9bc3..28c8a686b 100644 --- a/modules/system/system.info +++ b/modules/system/system.info @@ -3,3 +3,4 @@ name = System description = Handles general site configuration for administrators. package = Core - required version = VERSION +core = 6.x diff --git a/modules/system/system.module b/modules/system/system.module index d2ad76018..bf1e7b93b 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -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( diff --git a/modules/taxonomy/taxonomy.info b/modules/taxonomy/taxonomy.info index aa9e52ea1..b1a219548 100644 --- a/modules/taxonomy/taxonomy.info +++ b/modules/taxonomy/taxonomy.info @@ -3,3 +3,4 @@ name = Taxonomy description = Enables the categorization of content. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/throttle/throttle.info b/modules/throttle/throttle.info index 6b65ce577..7bdc100f0 100644 --- a/modules/throttle/throttle.info +++ b/modules/throttle/throttle.info @@ -3,3 +3,4 @@ name = Throttle description = Handles the auto-throttling mechanism, to control site congestion. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/tracker/tracker.info b/modules/tracker/tracker.info index 0dceed5b9..2375bc01a 100644 --- a/modules/tracker/tracker.info +++ b/modules/tracker/tracker.info @@ -3,3 +3,4 @@ name = Tracker description = Enables tracking of recent posts for users. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/upload/upload.info b/modules/upload/upload.info index a0d2c4068..dfb83d224 100644 --- a/modules/upload/upload.info +++ b/modules/upload/upload.info @@ -3,3 +3,4 @@ name = Upload description = Allows users to upload and attach files to content. package = Core - optional version = VERSION +core = 6.x diff --git a/modules/user/user.info b/modules/user/user.info index be836c41e..6059609ab 100644 --- a/modules/user/user.info +++ b/modules/user/user.info @@ -3,3 +3,4 @@ name = User description = Manages the user registration and login system. package = Core - required version = VERSION +core = 6.x diff --git a/themes/bluemarine/bluemarine.info b/themes/bluemarine/bluemarine.info index 15646d9df..38c338537 100644 --- a/themes/bluemarine/bluemarine.info +++ b/themes/bluemarine/bluemarine.info @@ -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 diff --git a/themes/chameleon/chameleon.info b/themes/chameleon/chameleon.info index 59f492733..2103648dd 100644 --- a/themes/chameleon/chameleon.info +++ b/themes/chameleon/chameleon.info @@ -8,3 +8,4 @@ features[] = favicon features[] = name features[] = slogan version = VERSION +core = 6.x diff --git a/themes/chameleon/marvin/marvin.info b/themes/chameleon/marvin/marvin.info index c77d66055..ac46c4e02 100644 --- a/themes/chameleon/marvin/marvin.info +++ b/themes/chameleon/marvin/marvin.info @@ -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 diff --git a/themes/garland/garland.info b/themes/garland/garland.info index 740e03425..32c000d92 100644 --- a/themes/garland/garland.info +++ b/themes/garland/garland.info @@ -2,4 +2,5 @@ name = Garland description = Tableless, recolorable, multi-column, fluid width theme (default). version = VERSION +core = 6.x engine = phptemplate diff --git a/themes/garland/minnelli/minnelli.info b/themes/garland/minnelli/minnelli.info index 3fb7d16a6..1ee55c846 100644 --- a/themes/garland/minnelli/minnelli.info +++ b/themes/garland/minnelli/minnelli.info @@ -2,4 +2,5 @@ name = Minnelli description = Tableless, recolorable, multi-column, fixed width theme. version = VERSION +core = 6.x base theme = garland diff --git a/themes/pushbutton/pushbutton.info b/themes/pushbutton/pushbutton.info index cbe4aca15..2f78fa4f1 100644 --- a/themes/pushbutton/pushbutton.info +++ b/themes/pushbutton/pushbutton.info @@ -2,4 +2,5 @@ name = Pushbutton description = Tabled, multi-column theme in blue and orange tones. version = VERSION +core = 6.x engine = phptemplate diff --git a/update.php b/update.php index 2dcda2914..21c33ff82 100644 --- a/update.php +++ b/update.php @@ -702,6 +702,37 @@ function update_create_batch_table() { } /** + * 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. */ function update_task_list($active = NULL) { @@ -747,6 +778,7 @@ if (($access_check == FALSE) || ($user->uid == 1)) { update_fix_watchdog_115(); update_fix_watchdog(); update_fix_sessions(); + update_fix_compatibility(); $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : ''; switch ($op) { |