see this issue: http://drupal.org/node/65801

Loading the custom group theme in og_init() has serious, negative side effects on performance and the localization module. Other modules that do theme switching (such as taxonomy_theme) do it in hook_menu, and in the Drupal API, it suggests putting code to be run once per page load in hook_menu.

Attached patch is a modest attempt to correct this by moving the theme-switching code to og_menu(). Initial tests (Drupal 4.7.2, PHP 4.4, MySQl 4.0.25) seem fine. The custom theme is still loaded, and now terms in og's blocks are properly translated by the locale module ( http://drupal.org/node/63033 ).

CommentFileSizeAuthor
#3 og_init-patch_1.txt1.12 KBpwolanin
og_init-patch_0_0.txt1.32 KBpwolanin

Comments

moshe weitzman’s picture

Status: Needs review » Closed (duplicate)

lets talk in the other issue. the views stuff had to happen in init in order to assure that it was available before views_init() is run.

there is no performance probem here. og_init() specifically does processing on non cached pages.

pwolanin’s picture

Moshe,

I left the views code in og_init() but only moved the theme code. I think there really is an issue, at least of functionality and probably performance too (based on http://drupal.org/node/65801). It's clear from my experience that wihout this change, og.module is making calles to t() before locale is initialized since t-ified terms in og's blocks don't get translated.

pwolanin’s picture

StatusFileSize
new1.12 KB

The existing og.module code calls node_load() during the init phase, which doesn't make sense if all the modules are not yet loaded at this point in the cycle: http://drupal.org/node/65801#comment-103994

attached is a slightly cleaner patch- the only differences are the comments and formatting, not the effect.