Skip to content

Commit 5c16678

Browse files
Issue #7: Set module weight higher (#8)
Setting higher module weight overrides other hook_custom_theme functions
1 parent 7bb3f6c commit 5c16678

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

layout_custom_theme.install

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* @file
4+
* Update hook and uninstaller for the Layout Custom Theme module
5+
*/
6+
7+
/**
8+
* Implements hook_install().
9+
*/
10+
function layout_custom_theme_install() {
11+
// Set our weight so that we execute last, to avoid other modules
12+
// setting a custom theme later.
13+
module_set_weight('layout_custom_theme', 99);
14+
}
15+
16+
/**
17+
* Implements hook_update_N().
18+
*
19+
* Set module weight higher so it can override other module custom themes.
20+
*/
21+
function layout_custom_theme_update_1001() {
22+
// Set our weight so that we execute last, to avoid other modules
23+
// setting a custom theme later.
24+
module_set_weight('layout_custom_theme', 99);
25+
}

0 commit comments

Comments
 (0)