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.
There are a handful references to hook_init()
left. Remove them, because the hook has been removed in #1911728: Remove hook_init().
Comment | File | Size | Author |
---|---|---|---|
#22 | interdiff-22-19.txt | 1.01 KB | snehi |
#22 | remove_references_to-2122087-22.patch | 1.06 KB | snehi |
#19 | remove_references_to-2122087-19.patch | 1.13 KB | rakesh.gectcr |
#15 | remove_references_to-2122087-15.patch | 1.12 KB | rakesh.gectcr |
#11 | remove_references_to-2122087-11.patch | 1.08 KB | alvar0hurtad0 |
Comments
Comment #1
XanoThe patch updates a code comment and removes two code usages in phptemplate.engine and twig.engine as I couldn't find any invocation of those hooks, and HEAD is not currently broken.
Comment #3
swentel CreditAttribution: swentel commentedWell, the init hooks in the theme engines aren't gone. One could argue they are poorly named, but they are called from _drupal_theme_initialize()
Comment #4
InternetDevels CreditAttribution: InternetDevels commentedUpdated patch.
Comment #5
Xano4: drupal-remove-references-to-hook_init-2122087-4.patch queued for re-testing.
Comment #6
tstoecklerCan we add a @see to _drupal_theme_initialize() ? That would be incredibly helpful.
Comment #7
BerdirSee also the changes happening in #340723: Make modules and installation profiles only require .info.yml files, the passed argument is no longer a stdClass. But it's probably better to wait with this until that issue has been committed to avoid unnecessary conflicts/re-rolls.
Comment #8
sunhook_init()
is part of the Theme Engine API — a crucial part even.It would probably be best to establish documentation for this callback (not hook) in
/core/modules/system/theme.api.php
At least, that is the API documentation file that documents all theme related callbacks and hooks. (I don't think we ever had proper API docs for theme engines.)
Closely related: #1685492: Convert theme engines into services
Comment #9
tim.plunkettSee also #1332068: ENGINE_render_template() and ENGINE_extension() are undocumented
Comment #10
star-szrThis is docs only so it's still viable for RC. Needs a reroll - phptemplate is gone but nyan_cat_init() is in :)
Comment #11
alvar0hurtad0that's the reroll.
Comment #12
subhojit777Patch seems ok to me. Thanks!
Comment #13
catchShouldn't the type hint be on the Extension class?
Comment #14
star-szrYeah and "Theme template object" doesn't seem right either anymore.
Comment #15
rakesh.gectcrI have done the following changes
Comment #16
rakesh.gectcrComment #17
catchComment #18
star-szrTheme template object still seems wrong, it's an extension object. So maybe something like "The theme extension object."?
Thanks.
Comment #19
rakesh.gectcr@Cottser
I updated to
Comment #20
rakesh.gectcrComment #21
lauriiiThe wording could be just simply "Includes .theme file from themes." because I feel like the information where its being loaded is more important than information what .theme file is.
Comment #22
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedDone as stated by #21
Comment #23
lauriiiLooks good for me! Thanks @snehi!
Comment #24
alexpottHmmm... the twig_init function seems a bit pointless no?
Couldn't...
be the following code instead...
I think we should consider refactoring this as theme engine loading was some of the last work we did before RC.
Is there a case where the $theme_engine . '_init' function will be more complex?
Comment #25
joelpittet@alexpott I think you are totally right. This is still RTBC as such but I've opened up a follow-up so that we can refactor the ENGINE_init to load.
Doubtful we can do that change in 8.0.1 as it's not a bug, but this one we can.
Comment #27
catchCommitted/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!