summaryrefslogtreecommitdiff
path: root/modules/block/block.install
diff options
context:
space:
mode:
Diffstat (limited to 'modules/block/block.install')
-rw-r--r--modules/block/block.install23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/block/block.install b/modules/block/block.install
index cc2dd690d..0b4544ed0 100644
--- a/modules/block/block.install
+++ b/modules/block/block.install
@@ -178,6 +178,16 @@ function block_schema() {
*/
function block_install() {
drupal_install_schema('block');
+
+ // Block should go first so that other modules can alter its output
+ // during hook_page_alter(). Almost everything on the page is a block,
+ // so before block module runs, there will not be much to alter.
+ db_update('system')
+ ->fields(array(
+ 'weight' => -5,
+ ))
+ ->condition('name', 'block')
+ ->execute();
}
/**
@@ -186,3 +196,16 @@ function block_install() {
function block_uninstall() {
drupal_uninstall_schema('block');
}
+
+/**
+ * Set system.weight to a low value for block module.
+ *
+ * Block should go first so that other modules can alter its output
+ * during hook_page_alter(). Almost everything on the page is a block,
+ * so before block module runs, there will not be much to alter.
+ */
+function block_update_7000() {
+ $ret = array();
+ $ret[] = update_sql("UPDATE {system} SET weight = -5 WHERE name = 'block'");
+ return $ret;
+}