I tried to get a list of all blocks for current user under current theme in my module. So I called block_list() function.
But at the very beginning of this function, it expects global variable $theme_key has been assigned. $theme_key is assigned in init_theme() function which is in theme.inc file.
My "page callback" function is invoked before init_theme() is processed so I can get nothing about blocks. What even worse is that, the block list is cached in block_list() function by static variable. So no blocks will be displayed in the request.
I also tried to modify block_list() function - use $conf['theme_default'] instead of $theme_key and it works.
I think block module should not have function depends on init_theme() is processed.
Or should I use another approach to get a block list?
Comments
Comment #1
zhangx1a0 commentedComment #3
dpearcefl commentedDoes this issue exist in current D6?
Comment #4
dpearcefl commented