diff options
-rw-r--r-- | includes/cache.inc | 4 | ||||
-rw-r--r-- | modules/block/block.info | 1 | ||||
-rw-r--r-- | modules/block/block.install | 14 | ||||
-rw-r--r-- | modules/block/block.module | 7 | ||||
-rw-r--r-- | modules/system/system.install | 5 | ||||
-rw-r--r-- | modules/system/system.module | 2 | ||||
-rw-r--r-- | profiles/default/default.profile | 7 |
7 files changed, 32 insertions, 8 deletions
diff --git a/includes/cache.inc b/includes/cache.inc index a7ad16214..21f79ba6b 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -150,7 +150,9 @@ function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) { if (!isset($cid) && !isset($table)) { // Clear the block cache first, so stale data will // not end up in the page cache. - cache_clear_all(NULL, 'cache_block'); + if (module_exists('block')) { + cache_clear_all(NULL, 'cache_block'); + } cache_clear_all(NULL, 'cache_page'); return; } diff --git a/modules/block/block.info b/modules/block/block.info index c7c842554..a74f5d721 100644 --- a/modules/block/block.info +++ b/modules/block/block.info @@ -8,4 +8,3 @@ core = 7.x files[] = block.module files[] = block.admin.inc files[] = block.install -required = TRUE diff --git a/modules/block/block.install b/modules/block/block.install index a35170425..db8a2f503 100644 --- a/modules/block/block.install +++ b/modules/block/block.install @@ -169,6 +169,20 @@ function block_schema() { } /** + * Implementation of hook_install(). + */ +function block_install() { + drupal_install_schema('block'); +} + +/** + * Implementation of hook_uninstall(). + */ +function block_uninstall() { + drupal_uninstall_schema('block'); +} + +/** * Refresh the block cache. */ function block_update_7000() { diff --git a/modules/block/block.module b/modules/block/block.module index c08bac949..982082df9 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -624,3 +624,10 @@ function _block_get_cache_id($block) { return implode(':', $cid_parts); } } + +/** + * Implementation of hook_flush_caches(). + */ +function block_flush_caches() { + return array('cache_block'); +} diff --git a/modules/system/system.install b/modules/system/system.install index 7b8f1e144..9300d758d 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -330,7 +330,7 @@ function system_install() { } // Create tables. - $modules = array('system', 'filter', 'block', 'user', 'node'); + $modules = array('system', 'filter', 'user', 'node'); foreach ($modules as $module) { drupal_install_schema($module); } @@ -369,9 +369,6 @@ function system_install() { db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'theme_default', 's:7:"garland";'); db_query("UPDATE {system} SET status = %d WHERE type = '%s' AND name = '%s'", 1, 'theme', 'garland'); - db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'login', 'garland', 1, 0, 'left', '', -1); - db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'navigation', 'garland', 1, 0, 'left', '', -1); - db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'powered-by', 'garland', 1, 10, 'footer', '', -1); db_query("INSERT INTO {node_access} (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (%d, %d, '%s', %d, %d, %d)", 0, 0, 'all', 1, 0, 0); diff --git a/modules/system/system.module b/modules/system/system.module index e3c7acaed..0db103ae3 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1553,7 +1553,7 @@ function system_cron() { } } - $core = array('cache', 'cache_block', 'cache_filter', 'cache_page', 'cache_form', 'cache_menu'); + $core = array('cache', 'cache_filter', 'cache_page', 'cache_form', 'cache_menu'); $cache_tables = array_merge(module_invoke_all('flush_caches'), $core); foreach ($cache_tables as $table) { cache_clear_all(NULL, $table); diff --git a/profiles/default/default.profile b/profiles/default/default.profile index 1c0b2a590..120228105 100644 --- a/profiles/default/default.profile +++ b/profiles/default/default.profile @@ -8,7 +8,7 @@ * An array of modules to enable. */ function default_profile_modules() { - return array('color', 'comment', 'help', 'menu', 'taxonomy', 'dblog'); + return array('block', 'color', 'comment', 'help', 'menu', 'taxonomy', 'dblog'); } /** @@ -90,6 +90,11 @@ function default_profile_task_list() { * modify the $task, otherwise discarded. */ function default_profile_tasks(&$task, $url) { + + // Enable 3 standard blocks. + db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'login', 'garland', 1, 0, 'left', '', -1); + db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'navigation', 'garland', 1, 0, 'left', '', -1); + db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'powered-by', 'garland', 1, 10, 'footer', '', -1); // Insert default user-defined node types into the database. For a complete // list of available node type attributes, refer to the node type API |