So here's a tangle (the goal is to have a custom theme per space):
og_theme sets a custom theme, given you're in an og_context. spaces_og sets that context fine in D6, but in D7 the theme/init order was changed in bootstrap -- custom themes are setup before hook_init() is called. PURL does it's magic in hook_init(), meaning space_og's og_context is activated during hook_init(), after custom theme is set, so og_theme (which works fine sans spaces) never gets set due to og_context being activated too late.
This is kinda a collaboration bug between spaces_og & PURL, see #1529842: og_theme doesn't work with spaces_og due to D7 boot sequence. The fix I'm using, which is terrible, is replacing PURL's hook_init with hook_custom_theme. hook_boot is too early (all kinds of errors due to modules not being loaded & path not available), hook_init is too late, hook_custom_theme is just right -- but completely nonsensical.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1529892-3-purl.patch | 452 bytes | grndlvl |
| #3 | 1529892-3-og_theme.patch | 448 bytes | grndlvl |
| #1 | purl_activate_in_hook_custom_theme.patch | 542 bytes | lefnire |
Comments
Comment #1
lefnire commentedagain, this patch does the job, but it's not ideal - just starting the convo
Comment #2
mkalkbrennerSame here with ThemeKey. I tried to access purl stuff created by mobile tools. My workaround is to call purl_init() from themekey_custom_theme() if needed.
@lefnire: Implementing purl_custom_theme() like in your patch doesn't fix the issue for all cases. It depends on the order all hook_custom_theme implementations.
Comment #3
grndlvl commentedI looked into this issue a bit and I really don't see a better solution.
For reference: _drupal_bootstrap_full()
I think we are stuck with this solution for now, however, I wonder if this would be better suited in og_theme.
Rerolled patch from within module's dir.
Also attached a patch for og_theme in case it is preferred to be be there instead.
Comment #4
abarket commented@grndlvl I posted an updated version of your og_theme patch in the og_theme issue queue here...
#1715712: PURL needs to be initialized if it exists
Comment #5
socialnicheguru commented1529892-3-purl.patch does not apply
Comment #6
kristiaanvandeneyndeFixed in #2599098: PURL activated too late..