Commit ce490556 authored by Nicholas Thompson's avatar Nicholas Thompson
Browse files

#1567790 - Fixing major bug with cache clearing and empty settings.

parent 282a1869
......@@ -637,6 +637,16 @@ function page_title_preprocess_html(&$vars) {
* Implement hook_init().
*/
function page_title_init() {
// Make sure our API includes are included on all page loads.
page_title_include_api_files();
}
/**
* Function to ensure API files are included.
* We use a static variable so we can use include, which is faster than include_one
*/
function page_title_include_api_files() {
// Using $runonce, we can ensure the include code below only gets run once.
$runonce = &drupal_static(__FUNCTION__, FALSE);
if ($runonce) return;
......@@ -807,7 +817,12 @@ function page_title_get_settings($flush = FALSE) {
return $cache->data;
}
// Get the settings from hoko_page_title_settings().
// We run this here as there are edge cases where it seems hook_init() and
// cache clearing intefere with each other, casuing INC files to not be included
// See: http://drupal.org/node/1567790
page_title_include_api_files();
// Get the settings from hook_page_title_settings().
$settings = module_invoke_all('page_title_settings');
// For each setting, apply a "default" mask (this makes it easier to use
......
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