Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Theme functions template_preprocess_menu_local_task()
and template_preprocess_menu_local_action()
defined in menu.inc
. After deprecations of the menu.inc functions would be logically to store template_* functions in the theme.inc file untill we will find better place or replacement solution for templeate_* functions.
Proposed resolution
Move this preprocess functions to the core/includes/theme.inc
Remaining tasks
patch, discuss, commit
User interface changes
no
API changes
no
Data model changes
no
Release notes snippet
no idea
Comment | File | Size | Author |
---|---|---|---|
#15 | 3021788-15.patch | 5.01 KB | Suresh Prabhu Parkala |
#13 | 3021788-13.patch | 5.01 KB | voleger |
Comments
Comment #2
andypostComment #3
andypostComment #4
volegerNice, let's move them.
Comment #5
alexpottYeah but their theme hook is defined in drupal_common_theme() which is in theme.inc.
I think rather than doing this piecemeal we should come up with a general rule of how core theme implementations should be registered and the templates and preprocess functions are located.
If we do this patch we're just going to be shifting a lot of code into system.module for all the theme implementations in drupal_common_theme() and that feels wrong.
Comment #7
andypostComment #8
andypost@alexpott Except this 2 functions and
menu_list_system_menus()
all other functions are deprecated inmenu.inc
So I think it's fine to move this 2 preprocesses to system module to get rid of include instead of looking for "general" solution
PS: maybe better move them to
theme.inc
for a while?Comment #9
volegerMove the
template_preprocess_*
functions frommenu.inc
totheme.inc
.Comment #11
volegerHere the patch for 9.0.x
Comment #12
volegerUpdate IS.
Comment #13
volegerJust rerolled
Comment #14
xjmThis would be a minor-only change. Since 8.9.x and 9.0.x are now in beta, I'm moving this to 9.1.x. Thanks!
Comment #15
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedPlease review.
Comment #16
daffie CreditAttribution: daffie commentedThe code changes look good to me.
For me it is RTBC.
Comment #17
xjmComment #19
lauriiiConfirmed that there aren't any code in the patch that would rely on something that was defined in between the current location and the previous location. There isn't many lines of code in between since these files are loaded after one another in
DrupalKernel::loadLegacyIncludes()
.Committed 0585f27 and pushed to 9.1.x. Thanks!