Do not call theme() in hook_menu()

Damien Tournoud - September 4, 2008 - 09:43
Project:Coder
Version:5.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

In Drupal 5 and before, nobody should call a theme() function in a hook_menu(), because it would initialize the theme system too early and prevent dynamic modification of the theme (for example in the block administration interface).

See for example #64409: Block settings not uniquely set for themes (unless set from default theme).

Could we write a rule for this?

#1

Damien Tournoud - September 4, 2008 - 09:44
Category:bug report» feature request

Of course, that's a feature request.

#2

douggreen - September 8, 2008 - 10:44

Do we have the same problem/restriction in 6.x?

#3

Damien Tournoud - September 8, 2008 - 10:59

The problem is irrelevant in 6 because hook_menu() is now only called during the menu rebuilding process.

#4

douggreen - September 8, 2008 - 18:09
Version:6.x-1.x-dev» 5.x-2.x-dev
 
 

Drupal is a registered trademark of Dries Buytaert.