1
1
Fork 0

Move rawContent before theme initialization

This commit is contained in:
Hypolite Petovan 2019-01-19 22:03:49 -05:00
parent 765784aad3
commit 89cb1b276d

View file

@ -1728,6 +1728,12 @@ class App
Core\Addon::callHooks($this->module . '_mod_init', $placeholder); Core\Addon::callHooks($this->module . '_mod_init', $placeholder);
call_user_func([$this->module_class, 'init']); call_user_func([$this->module_class, 'init']);
// "rawContent" is especially meant for technical endpoints.
// This endpoint doesn't need any theme initialization or other comparable stuff.
if (!$this->error) {
call_user_func([$this->module_class, 'rawContent']);
}
} }
// Load current theme info after module has been initialized as theme could have been set in module // Load current theme info after module has been initialized as theme could have been set in module
@ -1742,12 +1748,6 @@ class App
} }
if ($this->module_loaded) { if ($this->module_loaded) {
// "rawContent" is especially meant for technical endpoints.
// This endpoint doesn't need any theme initialization or other comparable stuff.
if (!$this->error) {
call_user_func([$this->module_class, 'rawContent']);
}
if (! $this->error && $_SERVER['REQUEST_METHOD'] === 'POST') { if (! $this->error && $_SERVER['REQUEST_METHOD'] === 'POST') {
Core\Addon::callHooks($this->module . '_mod_post', $_POST); Core\Addon::callHooks($this->module . '_mod_post', $_POST);
call_user_func([$this->module_class, 'post']); call_user_func([$this->module_class, 'post']);