Download & Extend

Prevent spaces_init() from being called twice in case it must be invoked before hook_init

Project:Spaces
Version:7.x-3.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

What reason might we have to do such a thing? It seems it's helpful in providing a custom theme.

hook_init is invoked after hook_custom_theme, which means we don't have an active space when the theme is determined. If in our site we put a call to spaces_init() in our implementation of hook_custom_theme, then we can use the active space to set the theme.

Currently, that causes the code in spaces_init() to run twice, because it's executed when hook_init is invoked. It's probably a good idea to let it run only once (unless you've got a reason to force it to reinitialize). Sound good?

Comments

#1

nobody click here