From 4bdf24ea52a0e661d84a13ec78a868cb50c46cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Mon, 28 Jan 2008 19:56:27 +0000 Subject: #210219 by htalvitie, yched: initialize block caching properties properly on install (and update bugos RC2 sites as well) --- modules/system/system.install | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'modules/system/system.install') diff --git a/modules/system/system.install b/modules/system/system.install index 30d0a5aaa..1de6f7401 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -68,7 +68,7 @@ function system_requirements($phase) { 'title' => $t('PHP register globals'), ); $register_globals = trim(ini_get('register_globals')); - // Unfortunately, ini_get() may return many different values, and we can't + // 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 @@ -393,9 +393,9 @@ 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 {blocks} (module, delta, theme, status, weight, region, pages) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s')", 'user', '0', 'garland', 1, 0, 'left', ''); - db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s')", 'user', '1', 'garland', 1, 0, 'left', ''); - db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s')", 'system', '0', 'garland', 1, 10, 'footer', ''); + db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', '0', 'garland', 1, 0, 'left', '', -1); + db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', '1', 'garland', 1, 0, 'left', '', -1); + db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', '0', '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); @@ -2479,6 +2479,17 @@ function system_update_6046() { return $ret; } +/** + * Fix cache mode for blocks inserted in system_install() in fresh installs of previous RC. + */ +function system_update_6047() { + $ret = array(); + $ret[] = update_sql("UPDATE {blocks} SET cache = %d WHERE module = '%s' AND delta = '%s'", -1, 'user', '0'); + $ret[] = update_sql("UPDATE {blocks} SET cache = %d WHERE module = '%s' AND delta = '%s'", -1, 'user', '1'); + $ret[] = update_sql("UPDATE {blocks} SET cache = %d WHERE module = '%s' AND delta = '%s'", -1, 'system', '0'); + return $ret; +} + /** * @} End of "defgroup updates-5.x-to-6.x" * The next series of updates should start at 7000. -- cgit v1.2.3