Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
af48df1c
Commit
af48df1c
authored
Sep 10, 2007
by
Gábor Hojtsy
Browse files
Options
Downloads
Patches
Plain Diff
#166681
by dvessel: fix behavior of theme 'override preprocess functions'
parent
e3daf88e
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/theme.inc
+12
-1
12 additions, 1 deletion
includes/theme.inc
with
12 additions
and
1 deletion
includes/theme.inc
+
12
−
1
View file @
af48df1c
...
...
@@ -220,6 +220,11 @@ function drupal_rebuild_theme_registry() {
* expanded upon; new entries will replace old entries in the
* array_merge, but we are careful to ensure some data is carried
* forward, such as the arguments a theme hook needs.
*
* An override flag can be set for preprocess functions. When detected the
* cached preprocessors for the hook will not be merged with the newly set.
* This can be useful to themes and theme engines by giving them more control
* over how and when the preprocess functions are run.
*/
function
_theme_process_registry
(
&
$cache
,
$name
,
$type
,
$theme
,
$path
)
{
$function
=
$name
.
'_theme'
;
...
...
@@ -292,7 +297,13 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
}
}
}
if
(
isset
(
$cache
[
$hook
][
'preprocess functions'
])
&&
is_array
(
$cache
[
$hook
][
'preprocess functions'
])
&&
empty
(
$cache
[
$hook
][
'override preprocess functions'
]))
{
// Check for the override flag and prevent the cached preprocess functions from being used.
// This allows themes or theme engines to remove preprocessors set earlier in the registry build.
if
(
!
empty
(
$info
[
'override preprocess functions'
]))
{
// Flag not needed inside the registry.
unset
(
$result
[
$hook
][
'override preprocess functions'
]);
}
elseif
(
isset
(
$cache
[
$hook
][
'preprocess functions'
])
&&
is_array
(
$cache
[
$hook
][
'preprocess functions'
]))
{
$info
[
'preprocess functions'
]
=
array_merge
(
$cache
[
$hook
][
'preprocess functions'
],
$info
[
'preprocess functions'
]);
}
$result
[
$hook
][
'preprocess functions'
]
=
$info
[
'preprocess functions'
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment