Commit 3cd9a1b2 authored by Dries's avatar Dries

- Patch #13405 by Moshe: make you actually do something useful with the init...

- Patch #13405 by Moshe: make you actually do something useful with the init hook.  A recent patch to 4.5 and HEAD made this patch run too early in the request (for non-cached pages).
parent aa1413d8
......@@ -402,11 +402,10 @@ function drupal_page_header() {
if (variable_get('dev_timer', 0)) {
timer_start();
}
bootstrap_invoke_all('init');
if (variable_get('cache', 0)) {
if ($cache = page_get_cache()) {
bootstrap_invoke_all('init');
// Set default values:
$date = gmdate('D, d M Y H:i:s', $cache->created) .' GMT';
$etag = '"'. md5($date) .'"';
......
......@@ -1793,8 +1793,8 @@ function drupal_get_path($type, $name) {
$_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node'));
}
// Load all enabled modules.
module_load_all();
// Initialize all enabled modules.
module_init();
if ($_REQUEST && !user_access('bypass input data check')) {
if (!valid_input_data($_REQUEST)) {
......
......@@ -6,6 +6,15 @@
* API for loading and interacting with Drupal modules.
*/
/**
* Initialize all modules.
*
*/
function module_init() {
module_load_all();
module_invoke_all('init');
}
/**
* Call a function repeatedly with each module in turn as an argument.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment