Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
page_title
Commits
7175e46f
Commit
7175e46f
authored
May 09, 2012
by
Nicholas Thompson
Browse files
#1567790 - Fixing bug with cache clearing breaking settings.
parent
1650b3a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
page_title.module
View file @
7175e46f
...
...
@@ -766,9 +766,13 @@ function page_title_get_settings($flush = FALSE) {
return
$cache
->
data
;
}
// Ensure that the page title inc files are included before invoking
// This helps avoid the issues in #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
// later as we can assume presence)
foreach
(
$settings
as
$k
=>
$v
)
{
...
...
@@ -812,12 +816,29 @@ function page_title_init() {
drupal_add_css
(
drupal_get_path
(
'module'
,
'page_title'
)
.
'/page_title.admin.css'
);
}
// Include relevant page_title.inc's
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.
static
$runonce
=
FALSE
;
if
(
$runonce
)
return
;
// Include relevant page_title.inc's. We cannot use drupal_load() here due to the folder structure.
// We also avoice using include_once due to its performance hit on the Filesystem
foreach
(
page_title_get_module_apis
()
as
$module
=>
$info
)
{
if
(
file_exists
(
"./
{
$info
[
'path'
]
}
/
{
$module
}
.page_title.inc"
))
{
include
"./
{
$info
[
'path'
]
}
/
{
$module
}
.page_title.inc"
;
$path
=
"./
{
$info
[
'path'
]
}
/
{
$module
}
.page_title.inc"
;
if
(
file_exists
(
$path
))
{
include
$path
;
}
}
$runonce
=
TRUE
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment